How do I get AI Navigation point data from Blueprints?

Hello,

Is there any way to get the navigation points from paths? I’ve found the “Get Immediate Move Destination” node which gives me one point, but I need the next one too.

Also is there a way to get the percentage along the current path section? I.e. I’d like to know when I’m 80% (for example) of the way to the current path destination (not the entire path).

I’m trying to find a way to smooth out the paths, so the characters don’t turn like robots when they reach each point in the path. If I know the next two points and how far along the first I am then it would be possible to blend between them.

Unless of course I’m missing a setting somewhere in the AI path following?!

Totally addicted to Behaviour Trees!

Thanks,

Mark

Hey Mark,

Did you find a solution to this? I want to smooth the path too.

Cheers,

Hey guys, so I haven’t found any way to make the AI move smoothly but below in the image is a basic example of how you might approach it.

Basically what you would be doing is getting the path data, getting the vector points (basically these vector locations are the points where you are finding your characters are all of a sudden doing an instant turn in that direction), than you can create a spline to have your character follow instead.

I can’t promise the below will actually create a spline, I’m still experimenting with creating splines at run-time, but that’s the only way I know of to create smooth movement for your characters that are using the navmesh.

You could also use the spline to create a dummy actor with no rendering, just to get a vector location that travels along the spline and the nav agent than just follows it, like in the AI follower tutorial.

But you’ll have to look at someone else’s examples of making things follow along a spline, like I said still experimenting with splines myself.

Anyways hope that helps, at least now you know how to get the navigation points.

Edit:

Oh and one last thing, from the path data output you can also get the path length. So what you can do to get the percentage of distance is store the path length before executing your Move To Location node, than on update(tick) continue to get the path length from your pawns current location and use the two floats to create a percentage progress value. I’m pretty sure there is a percentage node somewhere but if you are unsure the math should be “Updated Path” / “Path Total” * 100 = Percentage of progress… about to sleep so don’t count me on the math part.

Anyways below is an image showing how to get the two values you’ll need.

That was very useful, I haven’t try yet but you gave me a lot of precious info.

much appreciated,
Daniele

It looks like somebody converted the solution to a plugin…
Marketplace plugin