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"

Pathfinding on a moving object / Local space pathfinding

So I'm looking to implement pathfinding on a moving object. Imagine a train or a ship or something like that. I implemented this in unity by transforming back and forth between local and world space when looking up where to go. That way I didn't have to recalculate the navmesh as the ship was moving. In UE4 however, it seemed to be even easier at first glance. I took the approach of parenting the navmesh to my blueprint-based ship.

Right now, this is working okay-ish but there are a couple of issues of varying importance.

  1. I can't seem to make the NavMeshBoundsVolume be a part of the blueprint. I would like for it to be a component so it's spawned together with the blueprint. Instead I have now resorted to spawning one manually in the scene and parenting it to my blueprint. This seems like a possible duplicate of the question asked -here- , I just thought I would mention it.

  2. (This is the biggest issue I'm having) Ordering a pawn through an AIController with MoveToLocation, will cause it to path towards a point in world space. Now imagine I order my pawn to go to the middle of my ship. While it's pathing there, I move the entire ship away. Suddenly, the middle of my ship is somewhere else and my pawn is pathing to some point outside the ship. I'm wondering if there's a good way to solve this. A very hacky solution would be to keep track of their target position in local space and on each tick re-order them to move to that location (converted to world space).

  3. I'm not sure what's happening right now since I'm not completely sure what navmesh options I have set up, but ideally I don't want the navmesh to update. The objects inside the ship are static and there's no reason to update the navmesh just because the ship is moving. Is it possible? If not, will having to remake several navmeshes for different ships all the time as they move around have a noticable impact on performance and/or pathing?

  4. This is more of an observation: I started out with the third person template and have been modifying it a bit. My characters didn't use to stay on the ship when I moved it but now they do. They aren't parented to the ship-blueprint but when I move the ship, the characters move with it. This is what I want, I just don't understand why it's happening.

I'm really hoping what I want is possible, in some way or another. It really is a core mechanic in my game.

Product Version: Not Selected
more ▼

asked Dec 29 '14 at 01:53 PM in Using UE4

avatar image

28 7 8 10

avatar image Siretu Jan 05 '15 at 05:48 PM

To add to this, it seems like the navmesh isn't replicating properly. I'm not sure if there's a way to turn on navmesh replication, although that's not really what I want.

Since I have the navmesh attached to my blueprint-based ship in the scen and the ship is replicated, I thought the navmesh would follow the replicated ship properly when the ship moves. This doesn't seem to work however.

When I try running a dedicated server, the navmesh stands still on the client I tried ejecting mid-game and looking at the navmesh position and it appears not to have moved. It also failed to path to places where the navmesh should have followed after moving.

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

2 answers: sort voted first

Currently navmesh on moving platforms is not supported, but it's really high on our priority list, so stay tuned (but don't hold your breath! ;) ). Regarding navmesh replication, it's not being replicated at all. Currently navmesh is present only on the server, by design. There are plans to load navmesh on clients as well, but that will be working reliably with static navmesh, unless you're willing to take the risk of navmesh differing between server and clients (which is fine if you just need it for information purposes on clients for example).



more ▼

answered Jan 07 '15 at 01:01 PM

avatar image

MieszkoZ STAFF
7.3k 223 57 412

avatar image Siretu Jan 07 '15 at 02:05 PM

Edit: Nevermind. The issue below was completely my fault and had nothing at all to do with the navmesh. In case someone is interested, I had a stupid check to see if the player arrived at their location which was basically: if (targetPos.X < 0). So it didn't go to places if they were below the platforms origin in X value.

Great! Thanks for the information. I guess I can do some workarounds for now. I have another similar navmesh issue that I ran into: I worked around the other problems by making a huge navmesh and having it rebuild during runtime.

The rebuilding works great if I move the platform forward, but if I rotate it, a part of it is no longer walkable, even though I used the console command "Show navigation" to confirm that the navmesh is rebuilt.

Here's some pictures showing the problem. picture 1, picture 2

In the first picture, the platform hasn't moved and the character can walk all the way to the edge. In the second picture, the platform has rotated around the bottom left corner using AddActorWorldRotation. As you can see, the navmesh updates but I still can't walk on the red triangle.

This is running with one player and no dedicated server.

avatar image dzernesto Jan 31 '18 at 04:36 PM

An update about this would be greatly appreciated. Right now i Have a big vehicle moving around the world, and i need the AI to move around this vehicle. Any ideas is this is achievable ?

avatar image burak.io Feb 27 '18 at 12:10 PM

@MieszkoZ An update about pathfinding on moving actors or a way-around would be perfect. Apparently you mentioned that it`s in your top priorities list in 2015, hello from 2018 :)

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

@MieszkoZ : is "navmesh on moving platforms" still high on the priority list? Any updates or ETA?

more ▼

answered Jan 20 '18 at 06:23 PM

avatar image

107 2 10 20

(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