As suggested, make sure you are calling your coroutine correctly. Also note, yield return null waits one frame, which means your while loop will go super fast overall.
@JoshWindsor The while statement makes more sense here if OP wants a loop to increase size based on the yield time and loop. An if statement would only increment it once when the coroutine is called.
That makes sense I haven’t been using while loops so that’s why I suggested an if statement. I think I will do some research and start using them myself. Tyvm!
@JoshWindsor The while statement makes more sense here if OP wants a loop to increase size based on the yield time and loop. An if statement would only increment it once when the coroutine is called.[/QUOTE]
Hey, yeah I’m using start coroutine so should all be good there. Not concerned about the speed of the loop. This was just a snippet to simplyfy and demonstrate my problem
Why would you use it in Update? That’s bad advice considering the posted code. Not only would that start up the coroutine every frame, thus quickly increasing the value of size due to multiple coroutines incrementing it, it also would continue to run the coroutine beyond it’s use.
I don’t know if was the object being disabled, but it was the child of a child of a child etc that had the script attached, and something was happening on the way