x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

Product Version: Not Selected
Tags:
more ▼

asked Aug 13 '14 at 04:45 PM in Blueprint Scripting

avatar image

MajorFailure
92 9 11 17

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

alt text

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.

alt text

more ▼

answered Mar 04 '15 at 06:34 PM

avatar image

Miroac
728 20 25 108

avatar image daniele_niero Mar 04 '15 at 09:32 PM

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

much appreciated, Daniele

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hey Mark,

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

Cheers, Dan

more ▼

answered Nov 03 '14 at 09:24 AM

avatar image

daniele_niero
116 2 8 82

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question