Hi, whenever I start my script, it just says: expecting }, found else. I can't imagine why :(
#pragma strict
var timer: float = 0.5; // set duration time in seconds in the Inspector
function Update()
{
timer -= Time.deltaTime; // I need timer which from a particular time goes to zero
if (timer > 0);
{
}
else // timer is <= 0
{
if (gameObject.active)
{gameObject.SetActive(false);
Debug.Log("gudten morgen");}
else
{gameObject.SetActive(true);
}
}
↧