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.

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?