Im trying to make a muzzleflash for a gun using particle effects, but I cant figure out how to make a particle emitter appear for a certain time period.
I tried java.util.timer:
muzzleTimer.schedule(
new TimerTask()
{
public void run()
{
muzzleFlash.setNumParticles(1);
try{
Thread.sleep(100);
}catch(Exception e){}
muzzleFlash.setNumParticles(0);
}
}
but the muzzleflash doesnt appear at all. I also tried setEnabled but this doesnt work too.
deleting the particle emitter from the rootNode doesnt work either, so does someone have an idea what to do?
if I increase the particle number from 1 zu 5 or so, it does take effect. but when I set it to 0 and then to >0 again, it doesnt appear.