paulbreuler / Pathfinding

A* path finding setup in Unity based on 3D grid
MIT License
20 stars 4 forks source link

AI accelerates after new path is found. #3

Closed paulbreuler closed 7 years ago

paulbreuler commented 7 years ago

Coroutine start stop changed in Unity 5.x forward. You can now store a reference to previous coroutine.

 Coroutine lastRoutine = null;

 lastRoutine = StartCoroutine(YourCoroutine());

 // [ ... ]
 StopCoroutine(lastRoutine);

Reference: http://answers.unity3d.com/questions/934490/stopcoroutine-is-not-stoppinsg-my-coroutines.html