Hey guys!
I’m trying to simply generate a random number. (either 1 or 2) and use that random number to choice a different “if condition”.
What I’ve got works, but only chooses the number 1 every time.
here’s what I have;
function Death ()
{
speed = 0.0;
var deathChoice = Random.Range (0, 2);
if ( deathChoice == 1 )
{
print ( deathChoice );
animation.Play("Death01");
yield WaitForSeconds (1);
Destroy (gameObject);
}
if ( deathChoice == 2 )
{
print ( deathChoice );
animation.Play("Death02");
yield WaitForSeconds (1);
Destroy (gameObject);
}
}