In your key down event or whatever your attacking event is, evaluate his health value against 0.
- Code: Select all
if (youractorshealth<1)
{
ChangeAnimation("youractor","actordeadanimation",STOPPED)
}
You may also wish to do a little more here like actually destroying your actor, adding your scoring as a result of killing the actor, create a new dead actor, start a timer for length of dead actor visible, etc.....
If you do these things, do the destroy actor last...