Hi!
I’m trying something a bit different from this course. I made my own Male and Female models and want the player to be able to choose between either one. They have different Avatars and will have different sound effects and animations, but will have the same controls and speed.
When setting up my Player, I made an empty GameObject and called it Player, then I stuck my Male and Female models (Player M and Player F) into that. So far so good.
That is, until I need to implement [field: SerializeField] public Animator Animator { get, private set; } to my PlayerBaseState. I can only pair one Animator to this, not two.
Right now if I make a third Player Animator and give it no Avatar, it conflicts with the two Animators I have set up under my M and F players (weird effects, I can link a video if you’d like).
How would I go about being able to pair both my Male and Female’s Animators? I was thinking of putting in something like GetComponentInChildren in my PlayerStateMachine, but am unsure of how to go about doing that without getting other errors.
Please let me know if I need to copy/paste my code.
Edit: I updated my PlayerBaseState to include //public Animator Animator; instead of the [SerializeField], and added Animator = GetComponentInChildren< Animator >(); Ideally, this would have worked. The parent Player object inherited the proper Player model’s animator, but I’m still having the same issue as before, where the player will move weirdly. (Animator doesn’t have space in between carrots in code, _ will cross out but < test > will stay)