- Home /
How to change the speed of an animation?
Hi, I have a player gameobject, to which i attached an Animator. Then in this animator, i created several animations, via the Animation tab in unity. One of those animations is called "Running" and i need to change the speed of this animation from my c# script during runtime. But i can't figure out how to access this animation and change its speed from the script.
In my c# script, this is where the animator object, which contains the Running animation, is saved:
var animator = GetComponent<Animator>();
So how do i go from here?
Answer by TrollHachem · Sep 20, 2014 at 03:48 PM
animator.speed = animSpeed;
I can't use that, since that changes the speed of all animations in the animator, and not just the running animation.
you can try that after the running animation is done , get it back to 1?
Your answer

Follow this Question
Related Questions
Using C# Enums to Control an Animator 2 Answers
Conflicting Animator SetTrigger 0 Answers
pause Animation 0 Answers
Is it possible to always make animations play differently? 0 Answers