In my game I have this portion where the character shoots the enemy 3 times to kill it (then deleted). Or, the character collides with it and kills it (then deleted) while also sustaining damage.
But before the enemy is deleted I wanted it to play an animation (“Death”) first then delete it.
Now, my problem is the animation death can still collide with the bullet and replays the Death animation when it does, and can still also collide with the character and can drain my character’s health when a prolonged collision.
Basically add an animation check and inverse it so that the damage happens only when the death animation isn’t playing. Same can be applied to the bullet’s collision event.
It’s deleting the health bar, so the next time around there’s nothing to pick so the other events probably aren’t going to be triggered. Try moving the animation has finished event 2 indentations to the left so it’s just a subevent of the is dead event.
EDIT: I mean it deletes it after playing the Death animation but while the Death animation is playing and I hit it again it goes back alive and well to it’s default animation
Unless there’s another event changing the animation, this plus changing the collision event should work. Do you have any other events or behaviors that might be changing the animation? Maybe an idle or directional.
Is there a way to not make the enemy “collide” with the bullet when it’s playing the Death animation? and also when it’s playing the Death animation that it does not deal damage to my character anymore when my character collides with it? I’d really appreciate any suggestion
It was mentioned previous, you can add a condition to make sure the animation is not “Death” or add the is dead condition and invert it so it’s basically is alive.
Conditions work like filters. You filter the objects that you want. In this case objects.thay are in collision and alive (inverted is dead)