- Home /
Animation Stop and Stay
I have try so many things but in the short way I just want to have an animation that it plays one time and then the animation stops and stay at the final part of the animation. So, how can I do this?
I have try using:
animation["rrifle"].time = 0.2;
and also time:
animation["rrifle"].speed = 0.1;
also using Play, CrossFade and the different forms of wrapModes and it does not work
Answer by Owen-Reynolds · Sep 06, 2011 at 02:12 PM
Set wrapMode, in the Inspector, to ClampForever. As you leave, it will usually ask if you want to Apply, but not always, so remember to check Apply.
A ClampForever animation never really stops -- it is "playing" the last frame over and over, so be sure not to use the Stop command. You can CrossFade and it will blend in, but won't blend out (it blends out as it finishes, and, again, it never finishes.)
Set speed to whatever you want. Don't set time -- that's the frame you're on. For example, setting animation["run"].time=0.2;
in Update will constantly snap the animation to whatever position 2/10ths of a second is, feeezing you in that spot.