I will add this as an answer, even if you have not put your code as resources. This will be my bet.
I made a game that also shares the animator with the same prefab files, but if you only call a GameObject that needs to be animated. It should not call other Animator calls. An object runs with different animators every time, even if the Animator file is the same.
To test this, I would suggest that every time you create an instance of your GameObject. Call it something else. eg.
public GameObject[] myPrefabs;
myPrefabs[0] = (GameObject)Instantiate(nameofPrefab);
myPrefabs[0].name = "myPrefabs0";
myPrefabs[0].GetComponent<Animator>().SetTrigger("Attack");
// SetTrigger, SetBool, SetInt. Since this is an animator
I use List instead of Array, but I think this is the easiest I can give.
Prefix naming is not required to fix your problem. But you need it so that you can check if this is the correct GameObject that accepts your Animator call
source
share