- Home /
The question is answered, right answer was accepted
How to get and change animation speed of animator?
Hello! I was doing well with animations until I stuck with this problem. I need to modify my animation speed to make my animation dynamic. I guess that the best way to do this would be to get my animation speed via Animator component, because I am using animator controller, but I can't find the right command to do this. Also, I can't find information about this, so please, help me if you know the answer. Thanks!
Answer by meat5000 · Feb 15, 2015 at 07:03 PM
You can only change it per Layer.
Here's an answer I knocked up previously, which includes a method of pseudo-Changing each clip speed.
http://answers.unity3d.com/questions/731173/problem-adding-animation-speed.html
Thank you for your answer and the link. This solved my problem.
Answer by Inan-Evin · Feb 15, 2015 at 07:04 PM
You can change the speed of the Animator component, but beware that will affect all of the animations attached to that component.
public Animator animator;
public float desiredSpeed;
animator.speed = desiredSpeed;
adjust the desiredSpeed value from the inspector. Last time I checked, there was no way to reach and change the clip speed, but that may be fixed with a latest update, I haven't checked the changelogs yet.
Follow this Question
Related Questions
Modifying animation keyframes using javascript? 0 Answers
Multiple Cars not working 1 Answer
How to increase and decrease the animation speed? 1 Answer
Even / Constant Speed and Jumping 2D 1 Answer
Distribute terrain in zones 3 Answers