Debug drawing nodes in scene view for point and click game using path finding

Hi all,

I’m working on a simple point and click game prototype (new to unity). I want the player to point and click and the character should walk there. Pretty simple. I wrote some A* path finding for this and it works. I did this by placing a game object above the platform and attaching my scripts to it. But I want to be able to visualise the node in the scene view and add/remove dynamically. Problem is my nodes are all drawn using gizmos as small cubes and these only show in the game view once the game is running. All the nodes are calculated at run time.

Is there a way to visualise my nodes in the scene view? I’ve enabled gizmos for both the scene and the game and they only show in game. The other way would be to create real game objects out of these node and attach a mesh render to draw them. Add a script to draw the nodes on a specific face of the platform, but seems quite expensive? Right now the Node object I have just stores its position and its parent nodes and is not a MonoBehaviour object.

What’s the best way to achieve this? I’ve attached a picture of what I want. Ideally I want to remove any node via the scene view so that I can visualise things.

Ok after some free weekends, I managed to put something basic together. Posting here on how I did it. I wrote an editor extension/plugin which allows you to set a node radius and a button to activate a free hand mode. This mode allows you to select any face of an object and add a node. This way you can connect nodes together on complicated shapes (will look to automate this in some way as well). There is also a button to generate a grid of connected nodes on panes or cube type shapes. You can set nodes on any face that you click on. Allowing the player to walk upside down and on side.

Then once you click on an object, it will spawn node game objects which are then connected and drawn using gizmos with the correct orientation and added as a child to the parent game object. Rays are cast in 4 directions to set its neighbours so you can find each nodes neighbours easily.

It’s still a work in progress, but I’ll continue to improve what I got.