start amimation when collides

Hello,

I made an animated platform in cinema 4d and i exported it to unity. When i play the game the animation starts. But i'd like the animation to start 2 seconds after when my character hits the platform.

Thank you

A more efficient way would be to use coroutines...

function IE_StartDelayed(fDelay: float)
{
    yield WaitForSeconds(fDelay);

    // Enter the code to start the animation after this...
}

Then inside your OnCollisionEnter call:

StartCoroutine(IE_StartDelayed(2.0));

You can change 2.0 to whatever time you want the method to wait.

var platform : String = "Platform";
var theTime = Time.time + 2;

function OnCollisionStart (collision : Collision)
{
    if (collision.gameObject.name == platform)
    {
       if (Time.time == theTime) || (Time.time >= theTime)
       {
           //Play the animation
       }
       else if (Time.time <= theTime)
       {
          //Don't play the animation
       }

    }
}

Maybe something like that?