Make Animator start at random frame 4.3

Hi, I have a bunch of creatures which spawn at the same time and play an animation.

Is there anyway to start their animations at random times as currently they all do exactly the same at the same time!

so far i have this…

#pragma strict

private var animator : Animator;


function Start () 
{

	animator = GetComponent(Animator);
	
	animator.playbackTime = Random.Range(0,20);

}

function Update () {

}

which naturally does nothing…

Any ideas???

Thanks a lot!

1 Answer

1

Answered my own question…

I did a work around where i set the speed to a random speed for each creature, then after 0.1 second returned it to normal.

private var animator : Animator;


function Start () 
{

	animator = GetComponent(Animator);
	
	animator.speed = Random.Range(0,2000);
	
	yield WaitForSeconds(0.1);
	
	animator.speed = 1;

}

How do i set this to answered?

Thanks for sharing the trick!