I have a Gnome prefab that has the Shooter.cs on it. I’m at the point where I’m just trying to get Update() to set the isAttacking bool to true by returning true every time from the IsAttackerAheadInLane() function. It works if I drop a prefab in the heirarchy, changing animation states nicely. The Gnome gets all agitated and tosses axes. But the cloned Gnomes never hit the hop and firing animation states. I’ve put debugs in, using the animator.GetBool(“isAttacking”), and that shows me that the Gnome(Clone)'s animator isAttacking parameter is in fact getting set to true. It’s like the transition never sees it, though. Furthermore, when I drop a Gnome in the hierarchy, run the game, and examine the Animator window, the isAttacking checkbox is checked, since it’s being set to true on every update. This is not the case for the Gnome(Clone), no check in the checkbox. I thought it might be an issue of not finding the right object’s animator using GameObject.FindObjectOfType(), so I’m using GetComponent instead. Debug statements seem to show that the animator is for the Gnome(Clone), but setting the parameter does nothing for the transition to the hop/firing states. Can anyone offer any helpful suggestions or guidance?
[Update] I went ahead with the rest of the video, and again, it works for the Gnome I manually place in the Hierarchy, but not for the Gnomes I place using the top-of-screen buttons. I suspect the issue is with the animator or the transform, but I can’t figure out what the actual problem might be. Oh, yeah, I’m using Unity 2017.0.1f.