- Home /
How do you pause or set speed of Animator layer/state?
Hey there,
I'm using a sprite with an Animator to transition between animation states. One layer is in a looping state which moves the object left and right. The second layer sits in an idle state until a trigger is called by script which moves the second layer state into a "duck" state -which plays an animation that makes the object duck down.
I want the object to pause its left/right movement animation while the duck animation is called without resetting the position. I've been looking around for a while now and can't find any way to pause layers without modifying their weight.
Is there a way to just pause the layers animations or set the speed of that layer to 0? if there is another way of doing this I would reaaaally appreciate the help!
Thanks
Answer by Zonerunner · Dec 11, 2015 at 04:38 PM
This question is super old but for other people: The way I found to do it is to set a "speed multiplier" variable on states in that layer and then control that animator float value from a behavior
$$anonymous$$ore details for this here: https://forum.unity.com/threads/changing-speed-of-animation-states-through-code.322327/#post-2244062
Your answer
Follow this Question
Related Questions
2D Animation does not start 1 Answer
Delete Object After Animation (2D) 6 Answers
How to limit my player speed (2D)? 2 Answers
Animation for dismembered limbs keeps playing 0 Answers
After animation completion transition to default animation 1 Answer