Hi, here’s the code:
#pragma strict
var animator : Animator;
var minWait = 5.0;
var maxWait = 20.0;
function Start () {
animator = GetComponent("Animator");
yield (WaitForSeconds(Random.Range(minWait, maxWait)));
if (true) {
animator.SetInteger("WaitAnimPick", Random.RandomRange(1, 3.5));
yield;
}
animator.SetInteger("WaitAnimPick", 0);
}
This code functions only once in the game. I’d like it to function again and again, over and over every 5 - 20 seconds.
Can someone help? Thanks.