In Shooter.cs around the 4 minute mark, we find the animator like this:
animator = GameObject.FindObjectOfType<Animator>();
I read that the GameObject searches the whole scene, which can become slow.
Would it be better to do this?
animator = this.GetComponent<Animator>();
(Both worked for me)
What really baffled me is if GameObject does in fact search the whole scene, wouldn’t it find multiple animators everywhere? How would it know which ‘one’ to grab? I can’t wrap my head around why FindObjectOfType works. The GetComponent makes sense.