- Home /
How to visualize each step of Pathfinding Algorithm on Screen?
I'm developing an A* pathfinding and I would like to see which nodes I'm expanding.
I have a number of tiles and on each "step" of the algorithm I expand from 0 to 4 tiles, searching the path, I would like to see visually which nodes I'm on, to do this, I'm changing the color from the node and returning a WaitForSeconds, but it doesn't work, Unity does all the processment before showing anything on the screen. I'm interested in seeing how the algorithm achieve the results, not only on the result.
I think that this is realated to anything step by step on Unity, how can I achieve these kind of thing? just using simple Coroutines doesn't seem to do the trick.
Answer by Baktillus · Sep 22, 2016 at 01:49 PM
If you want to Pause execution at certain moments you could use Debug.Break(); I dont know how your script is structured, but make sure that your nodes are actually being visualised in some way at the time you are inspecting what is going on.
Also regarding Coroutines, they should definitely halt with "yield return new WaitForSeconds(5)". if they don't, maybe you called a different function from within the coroutine?
Your answer
Follow this Question
Related Questions
Problem with calculated path of a NavMeshAgent 0 Answers
Duda script A Start Pathfinder 0 Answers
A* Pathfinding on click? 0 Answers
How to minimize directional changes of A* autopathing movement? 0 Answers