When I execute the code I get the following exception:
MissingComponentException: There is no ‘Animator’ attached to the “Player” game object, but a script is trying to access it.
In the previous lesson we created a nested prefab Player > Character_Knight_Soldier. I realized that the nested prefab Character_Knight is the one with the animator component, while the Mover.cs script is in the father Player. So I was wondering, did you reassign the Animator from the son object to the father Player?
However, I wonder: couldn’t the script access the component of its children game objects? What’s the purpose of having some components in the child object if it can’t?
Thanks!