Answer the question
In order to leave comments, you need to log in
How to change the playback speed of a 2D animation through code?
With animation["animation"].speed, nothing happens and the console says that the GO to which this script is attached does not have any animation, although it is animated (through the same script) and everything works fine.
So how can I change the playback speed of a Clip through code?
Answer the question
In order to leave comments, you need to log in
In general, the solution is:
Animator animator;
animator = GetComponent<Animator>();
animator.speed = 1F;
Could you schematically describe your GO; where exactly is the script attached; a piece of code where you change the speed and completely error.
PS: animation["animation"].speed should work, the problem, apparently, is in some trifle
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question