How do I activate an animation when a gameobject enter the Collider of the other animated object

Hi, I’m new on unity , and I want to make an animation on several gameobjects, with a delay between them.
I have 2 animated objects, the first starts when the game is played and the second needs to be triggered only when a gameobject (that is following a way via an other script) enters it’s collider( that I’ve set to be the Trigger).
To do so I’ve made an animation controller tht switches between two states ( 'Idle’and ‘playing’) in btw those two states the value of a Bool ( named ‘trans’ changes from true to false) , this value is going to be used in the script as follows :

using UnityEngine;

using System.Collections;

public class testcylindre : MonoBehaviour {

public bool trans;

private Animator ani;

private GameObject Player;

void Start () {

// Update is called once per frame
void Update () {
	ani = GetComponent<Animator> ();

void onTriggerEnter(Collider other){
	ani.SetBool ("trans", true);

void onTriggerExit(Collider other){
		ani.SetBool ("trans", false);


But when I play the scene even when the objects enters the collider the animation doesn’t begin, and when i’ve opened the Animator window while thegame is playing i’ve noticed tht the Idle state is always looping and it doesn’tgo to the Playing state where the motion is set to the animation.

Any help wiould be welcomed, thanks in advance.

I’ve found the SOLUTIOOON . ok maybe because i’m a noob I didn’t knew this, but basically you have to add the property Rigid Body and set kinematic to true and The object coming towards the animated to be other object will be recongnized by it’s collider and therefore the animaton will be triggered.