die animation keeps on looping!

Hi, I've got a third person game in which you have to shoot zombies. When my character dies, i want it to play a die animation. So i used animation.Play("die"), but it keeps on looping, even when i set the WrapMode to Once. What am i doing wrong?

Arne Gevaert

Perhaps you are calling `animation.Play("die");` every frame (using an if-test to see if the player is dead?)

If I remember correctly; In that case you should not set WrapMode.Once, but instead use WrapMode.ClampForever. Alternatively, you could try make sure you only call animation.Play once, not several times. If all this fails, make sure you did set the proper wrap mode on the proper animation. You can either do this via the animation inspector or via scripting.

Thank you very much, i’ve set the WrapMode to ClampForever and it works!