Hello. I am trying to play and animation and then destroy the object, however, I can either have the object being destroyed before the animation is noticed, or the animation happening but the object not destroyed. Hoping someone might be able to help with this. The code I am trying to use currently is
the code is in a function that will be called from a physics.add.collider.
I have tried the following. but the enemy zombies do not become destroyed, It only repeats animation. And the console.log string does not print out either.
yes they are what I think they are. I checked with the code, and also tested by destroying each one. adding true in still did not help with the situation
I do not believe so, when I used breakpoints in the browser, the code goes from enemy.play → enemy.once and then skips the rest of the code, so no console call or enemy.destroy
I have got it working now. Not sure what the issue was. I redone the code for the animations and it is now working. Thank you for taking time to try and help me.