Delayed code execution with Unity's coroutines
Posted on 1 Feb 2017 - 18:10
Sometimes a chunk of code must be executed one or more frames ahead, sometimes because it’s just convenient to do so, other times because your code simply wouldn’t work otherwise.
Mind that if you are in this situation, you should first ask yourself why. In fact, having to delay your code of one or more frames can be a symptom of engineering mistakes. But it may not depend on you. I had these situations in the past and the cause were most of the times external libraries or code from someone who left the company.