- Home /
ANimation doesn't rewind on animation.Stop
Hi guys. What am I doing wrong? I have a simple Jump animation, runs with Input.KeyCode(Space):
function Update () { if(Input.GetKey(KeyCode.Space)){ animation.Play("JumpAnim1"); } if(Input.GetKeyUp(KeyCode.Space)){ animation.Stop("JumpAnim1"); } }
Scriptin Reference says: "Stopping an animation also Rewinds it to the Start." Animations starts and stops but never rewinds? No matter the wrap mode.
Answer by Steffen Franz · Jan 31, 2011 at 07:24 PM
have you tried Animation.Rewind?
Yes, but effect is strange. Animation rewinds, plays a while and stops in random frame :(
Answer by 3DMagicVR · Jan 31, 2011 at 07:25 PM
Hi, You want to play backwards the animation when the character start to fall down to the ground?, if that's the case you must use a function to change the animation.speed from a positive value to a negative value this way you can play an animation backwards.
Try to use a limiter to achieve this animation control if you don't your animation will be in loop, if your are using the loop wrapmode for your animations and don't forget to use the animation.CroosFade() to blend the animations.
Answer by kecaj · Jan 31, 2011 at 10:59 PM
Ok, solution is just simply remove "if(Input.GetKeyUp..." part. Animations finishes playing and stops. It is very short animation so it does no matter it doesn't stop immediately. Most important is that my caracter doesn't freeze in strange pose. Anyway thanks for your answers AngryGerman and 3DMagicVR :)
Your answer
Follow this Question
Related Questions
Trouble with animation Rewind/stop 0 Answers
Mecanim: Stop/Hold Animation at the end 3 Answers
Animation.Rewind Isn't Working 1 Answer
Making an animation stop once it finishes (trouble with booleans) 1 Answer
Stop animation from playing 1 Answer