float timer ;
Voif update ()
{
timer += 1 * time.deltatime;
If (timer >= 5)
{
//other code
debug.log ("hello")};
}
}
just to do it
float timer;
void Update()
{
timer += 1 * Time.deltaTime;
if (timer == 5)
{
//other code
print("hello");
}
}
You could add in a flag calledAlready to ensure it is only called once.
float timer;
bool calledAlready = false;
void Update()
{
timer += 1 * Time.deltaTime;
if (! calledAlready)
{
if (timer == 5)
{
calledAlready = true;
//other code
print("hello");
}
}
}
Thanks a lot it works