The question is answered, right answer was accepted
Same animation on different prefab object.
Hi!!
1) I create prefab "Sheep".
2) Add animator and some animation to it:
3) Add animator int parametr "RandomAnimation".
4) All transaction from "Sheep" to other have condition ( "RandomAnimation" equal 1,2,3 - ):
5) Than i add code to set random int to "RandomAnimation":
System.Random rnd = new System.Random();
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
animator.SetInteger("RandomAnimation", rnd.Next(0, 4));
}
6) When i add some object (this prefab) to scene, all of this object have same animation (same "RandomAnimation" parametr at same time).
How can i make that all of this object have they own animator with own "RandomAnimation". I want create many object, that show different animation on same time.
THX!
Follow this Question
Related Questions
Why can't I delete animator parameters? 2 Answers
Have Animator ignore parameters, pass Animation state manually? 0 Answers
Animator consecutive set parameter problem 0 Answers
Can't add animated properties to a 3D character in 2018 0 Answers
Prevent Snapping from Custom Bone Rotation to Animation 0 Answers