Show Navigation Path during gameplay

Heya other UE4 tinkerers,

So I’m trying to display the Navigation Path in either a spline or some such (still not sure about how to do this, hence why I’m here) and yet I’m kind of banging my head here.

I’m using the hit location for a ray cast under the cursor to get the target location for the simple move to I just can’t figure out how to display the path that my AI will go, can’t even find a debug mode that will show it.

You could use ‘Find Path to Location Synchronously’ node in the Blueprints, and then specify the starting location, destination. It will output the path points that determine the navigation path. You can then use these to create a spline along these points.

For debug-drawing of AI’s path you can use either log visualizer or gameplay debugger.

You summon Log Visualizer’s UI by calling ‘vislog’ console command (there’s a button somewhere for it in the editor, I just never use it :smiley: ). Start recording, click on you AI’s log and it will draw result for you.

Ways of using gameplay debugger depends on your game mode. In regular game it should be able to turn it on just by point at an AI and pressing ’ - key. Or you can do that in simulation mode, where you just select/click your AI and debug data will show, provided you have AI debugging flag enabled (it’s in viewport’s Show -> Developer -> AI Debug).

Cheers,

–mieszko

I’ve managed to do this with just creating objects where the path points are, will try with a spline and reply with the results.
Are you able to increase the amount of path points it gives? Like say every X amount of distance over the path it will give you a path point to use.

Once you get the path points, I believe you could create more points based on the given points, say like using midpoints or so if you want. But otherwise, I don’t know if it’s possible to get them directly through queries. I think Mieszko will be able to answer that.

Showing the navigation path is completely doable using splines. What I did, is I used the points that I got, and used them as the points for my spline. There will be some stretching of the mesh ofcourse, but in my case, since I’m using a plain material, there’s no visual representation of the stretching.

Paths you get as a result of pathfinding query are by default string-pulled, which means all redundant points are optimized-out. No way to get extra points.

Great tool - I need more monitors :slight_smile: