- Home /
Pause and resume coroutine
Hi, im moving and object with a coroutine and I want pause and resume the coroutine. How could do that?
Comment
Best Answer
Answer by Jessespike · Feb 18, 2015 at 06:43 PM
One way is to make a loop that is conditioned by a bool
while (isPaused)
{
yield return null;
}
This should be put inside the same while loop as the other yield return null.
while (true)
{
while (isPaused)
{
yield return null;
}
// Do Something
yield return null;
}
Your answer
Follow this Question
Related Questions
Pause and resume coroutine 0 Answers
pause,resume and save coroutines 2 Answers
Coroutines, WaitForSeconds with function Update? 3 Answers
2D main menu as a different scene - pausing and resuming 0 Answers
Audio keeps playing when paused 1 Answer