Hello!
I would like an object to blink for 3 seconds. I have wrote the following code, but Unity is not entering to function blinking(). What do I do wrong?
var blinkTime : int = 3; //How long the sphere will blink
function Start()
{
InvokeRepeating("blinking", 1, 1);
}
function blinking()
{
print(blinkTime);
blinkTime--;
print(blinkTime);
if (blinkTime == 0)
{
Object.Destroy(Object.name);
}
else
{
yield WaitForSeconds(0.5);
renderer.enabled = false;
yield WaitForSeconds(0.5);
renderer.enabled = true;
}
}
Thanks!