Check if character has entered trigger, if it has play animation on character.

I’m trying to problem solve an issue I’m having.

Basically I have a trigger zone, and when a character enters the trigger zone, I want an animation to play on the character that has just entered the trigger zone.

I vaguely understand that to make this happen I need to attach a script to the trigger zone that says

Play("Jump1", PlayMode.StopAll);

But I don’t know how to get the trigger to recognize when and which character has entered it, so the animation plays on the character inside the trigger, not the several instantiated ones outside the trigger that are tagged the same.

Is there a way I can change a boolean value only on the character that has entered the trigger?

First tag your players on gameobject . After that just check the tag and do your rest work. Like :

void OnTriggerEnter(Collider other) {
       if(other.tag.Equals("Player")){ 
             //Rest Work
         }
}