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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Predefined AI Pathfinding

Hello All!

I am currently building an Vehicle AI system for my project and am currently stuck on one little thing. I have used the "Find Path To Location Synchronously" node to get an Array of locations to move to. Its all good at this point however, using a For Each Loop, it will only move to the last Location in the array. How can I make it go though each one individually then move to the next one.

alt text

Thanks for any help!

Product Version: UE 4.16
Tags:
snip.png (107.3 kB)
more ▼

asked Jul 29 '17 at 08:34 PM in Blueprint Scripting

avatar image

TheSecondSense
150 6 9 17

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Not sure which built-in MoveTo node you're using, but anyway they just set the AI's target, and the AI will take over and navigate until it gets there. So if you call it in a loop, all you're doing is overwriting the target each time, so you end up with the last one in the list. If you want to apply them sequentially, you'd need to bind an event to ReceiveMoveCompleted to start the next movement command.

Do you have a reason for wanting to break up the path like this anyway? The path points are just a series of straight line segments along the nav mesh, if you just pass your OwnerLocation directly to a single call to one of the MoveTo nodes then it will follow each segment in sequence until it gets to the end.

more ▼

answered Jul 31 '17 at 07:31 PM

avatar image

kamrann
2.1k 83 33 119

(comments are locked)
10|2000 characters needed characters left
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