How to apply one code for all animations?
I have animation. When it ends, I play it again in the revert direction with the code:
animation["boxOpen1"].speed = -1.0f;
animation["boxOpen1"].time = animation["boxOpen1"].length;
But I need to use this code with animations boxOpen[1-10]
for different objects and I can't write code animation.speed = -1.0f;
And I can't call all animations boxOpen1, because they must have unique name. How can I use this code for all animations?
Answer by lassade · Jan 15, 2016 at 05:21 PM
Make "boxOpen1" a public string so every object can have its own animation name.
As a suggestion try out the unity mecanim system.
Your answer
Follow this Question
Related Questions
How too climb a ladder with the FPS Controller correctly 0 Answers
Animation won't stop (Solved) 2 Answers
MobController 1 Answer
how to link URL into multiple buttons in a condition "if" 1 Answer
Animator Is Not A Playable Error. 1 Answer