Hi guys, we’ve been crushing the heads on a wall for 3 days for this problem.
I have a prefab instantiated several times by a script in the game scene. The prefab is composed by 2 objects, one inside the other. The Main_object and the inside_one. The inside_one has got an animator. It works perfectly for a month. We introduce a Network system, and it continue to works fine. 3 days ago the animator system starts to go mad (and we follow).
I know is not professional to say something like this but situation is very strange:
the inside_one has got a Animator component witch its Contoller is called Card_animator_controller and has got two layers and 8 parameters.
In a script linked to the Main_object we use:
public Animator anim;
anim = transform.FindChild("inside_one").GetComponent<Animator>();
if (anim) //we put this just to be sure
Debug.Log ("Animator Exists!");
Debug.Log ("anim controller: " + anim.runtimeAnimatorController.name);
Debug.Log ("anim num of layers: " + anim.layerCount);
anim.SetInteger("NameOfTheParameters", 0);
AnimatorStateInfo infoAboutAniamtor = anim.GetCurrentAnimatorStateInfo(0);
these debugs produce this output:
“Animator exists!”
“anim controller: Card_animator_controller.”
“anim num of layers: 0” (what?)
Waring: Parameter ‘NameOfTheParameters’ does not exist. (what!?)
Error: Invalid Layer Index (WHAT!?)
this is a snapshot of the Card_animator_controller:
[18695-animator+fail.png|18695]
Any help would be grat! Thanks