Referencing an Animator component from a parent object?

I’m trying to reference an animator which does all the animations for a player’s weapon, including:

  • Aiming down sights
  • Movement
  • Reloading
  • Firing

I want to do this from a scrip attached to the player since this script controls when the player can fire and reload, how much ammo to load, etc.

I am using JS

How do I do this? Feel free to ask questions for more info. Cheers.

You can use GetComponentInChildren or GetComponentsInChildren to create a reference to a component that is attached to a child object.