Hi there… I would like to start the animaton after 5 seconds, so I added “yield WaitForSeconds (5)”, but If I add that line, the animation doesn’t start anymore… why?
var Animazione = "Vagone";
var on : boolean;
function Update () {
if (Input.GetKey(KeyCode.Q)) {
on = !on;
if (!on){
yield WaitForSeconds (5);
GetComponent.<Animation>()[Animazione].speed = 0.5;
GetComponent.<Animation>().Play(Animazione);
}
if (on) {
}
}
}