Check the docs to see why your StopCoroutine() isn’t working. You’re stopping a brand-new coroutine, not the one you ran.
Generally if you contemplate stopping a coroutine, then a coroutine is not a good solution.
Coroutines in a nutshell:
Splitting up larger tasks in coroutines:
Coroutines are NOT always an appropriate solution: know when to use them!
Our very own Bunny83 has also provided a Coroutine Crash Course:
https://answers.unity.com/questions/1749615/coroutines-ienumerator-not-working-as-expected.html?childToView=1749714#answer-1749714
1 Like