I’m having an animation start with the “animation.Play(animation)” but it keeps looping. I set my wrapmode from default to Once, but I can’t seem to get my animation to only play once. Anybody know what I might be missing?
I’ve also set the wrapmode to Once.
Thus far I have:
/////////Animation is already attached to the game object
function Update()
{
if(talkTo Input.GetKey("n"))
{
animation.Play("FaceManMove");
talkTo = false;
}
}
Yes. In the code I have above you’ll notice once N is press just once it won’t call that same code. So it should only play the animation just one time.
But for some reason it gets in a loop.
When the animation is done playing it restarts and never finishes unless I kill the engine.
This forces the animation to play once instead of wrapping (and how I’ve solved the same issue.) What I don’t get is why this is even necessary: the documentation states that animations are supposed to be in ‘WrapMode.Once’ by default.
When I play that “animation.wrapMode = WrapMode.Once;” Will that kill all the other animations attached to the object as well or just the one called out in animation.Play?