- Home /
How to loop an animation in reverse?
Good morning, fellow Unity developers!
I've been browsing the Unity answers and google to see if there is a solution to my problem; I haven't found it yet. Basically I have a game where I need an animation to play forwards and backwards but am having a problem with playing it backwards. I thought I was playing it backwards using this: http://docs.unity3d.com/ScriptReference/AnimationState-speed.html Except I call it from an Animator, so I'm really using this: http://docs.unity3d.com/ScriptReference/Animator-speed.html The animation plays backwards just fine except it only loops for for how long I allow the animation to loop forward. So if I start the animation and it loops forward twice, then the animation will loop backwards twice and freeze on the first frame. Does anyone know of a way to get the animator to loop regardless of how many times it is played forward? Below is the code I am using:
else if (anim.GetBool("Moving") == true && hraw == -1)
{
anim.speed = -1;
}
Your answer
Follow this Question
Related Questions
Playing animation in reverse plays it once only! 0 Answers
How to make a 2d animation repeat 1 Answer
Trying to add value to a float in animator each time an animation plays. 0 Answers
Chande animation speed 1 Answer
Play animation backwards 1 Answer