Getting My FPS Controller To Play An Animation After A Trigger Event

Okay so I’m not yet fully accompanied with scripting, if anything I use Java. But my issue is, is that I wanna make it so that when my fps controller passes a trigger, the fps controller itself plays an animation. I don’t know any script that would help so I’m asking the community, please help if its not much.

if its an animation for the “Player” (where like the camera moves).
Then try this:
Make and Put an animation on the “Player”, and then put this script on the object “Player”

#pragma strict

var animationName : String;

function OnTriggerEnter(theCollider : Collider) 
    {

	animation.Play (animationName);
	Debug.Log("Triggered");

   }

(Remember to put “Is Trigger” on the Collider. And make the animation, from where the Collider starts)
Hope this helps you, and if not. Then just tell me :slight_smile:
(Also, dont set the animation to “Play Automatically”)