- Home /
Sequentially wait for multiple coroutines to finish
Hi all. I couldn't find anything in Unity answers regarding multiple coroutines so I hope to see if you guys can help. My intended mechanic: When the user clicks and drags the mouse I want the character's arm segments to "stretch" and meet the location clicked. This tracking is called every Update() and should follow the mouse.
Right now my drawArm(...) function draws entire "arm segments" in a loop and is called every time the user moves the mouse around with the mouse button held down. Calling drawArm(...) every Update() works but lacks the animation I need. Starting a Coroutine produces the intended effect but if the mouse is moved fast enough, arm segments are drawn before the first coroutine finishes.
What would be the best way to check that a previous coroutine is finished before continuing?