Having an Animation play when close to 1st person controller

I would like it so when you get close to an object, it would play an animation once. I’m just not sure how I would accomplish this, or even if this is possible. If anyone knows how, it would be awesome. Thanks!

Step 1: Create an animation for the object. Give it a name in the Animator compoent.

Step 2: Create a sphere collider thats the right size, attached to your object. Set it as a trigger

Step 3: Write an OnTriggerEnter script to respond when someone enters the sphere

Use Unity - Scripting API: Animator.Play to play the animation in the OnTriggerEnter routine,