Hi guys - my first post.
Looking forward to getting into Unity. My biggest stumbling block is coroutines… just don’t seem to be getting it. The best way to describe my question is by asking why the code below doesn’t work. What seems to be happening is flicker() is being called every frame so several flicker () threads are running in parallel…how would this be best amended?
Thanks!
function Update () {
flicker();
}
function flicker()
{
yield WaitForSeconds(1);
light.enabled = false;
yield WaitForSeconds(1);
light.enabled = true;
}