I just can’t work it out. I’ve not used Invokerepeating before but the code examples I found seemed so simple that I can’t believe my similarly simple code is hitting a snag.
function Start () {
InvokeRepeating ("switcher",2,2);
}
function switcher()
{
Debug.Log("function called");
on = true;
yield WaitForSeconds(2);
on = false;
}
The debug.log doesn’t appear so I know the function is not being called.
I’m obviously missing something simple, sorry guys! let me know if you need any more info.