Nav mesh on moving platform?

I’m making an elevator, and my game is click to move, so I need each floors’ navmesh to update to include the elevator platform when it arrives.

I’ve set “runtime generation” in the project settings to “dynamic”, and it works, but it sounds kinda expensive.

I’ve tried “dynamic modifiers only” but it seems to only work for excluding stuff from the navmesh, not including. or I don’t know how to use it properly.

how should I do it?

1 Like

Is this possible even?

I could get away with telling the game to update the navmesh as the elevator platform reaches another floor, but couldn’t find how to do this

I’ll bump this one cause it feels like this should be trivial

Can you upload screenshots and/or a video of what you’re doing?

I had a similar issue with a train system that I was creating (station platform logic), but I’m not sure how similar my case and solution is to yours.

Just keep in mind that NavMeshes are really not meant to be dynamic. They can be, but when they are, they’re very inflexible. This is for stability, performance, and consistency.

I’ve found that the dynamic NayMesh is not really for movement, but for actors that come in and out of existence (i.e. loading/unloading levels/zones); that way your character doesn’t avoid bumping into phantom objects or fall through floors that no longer exist.

1 Like

sure thing:

my game is top down with a click to move system, which relies on navmeshes.

here’s what happens to the navmesh when the platform moves:

I want to be able to exit the lift platform at any floor and click to move out of it, but as a static runtime generation for nagivation, it only works at the level the navmesh was generated (in this case the lowest floor)

if I change this to Dynamic, it works all the time, but it also rebuilds the navigation all the time as something moves through the navmesh, which impacts performance, so it’s not ideal.

what I wanted was to rebuild navigation just once when the platform reaches another floor, which would have minimal impact compared to dynamic, but I don’t even know if that can be done.

there’s a “dynamic modifiers only” option, which I thought could do what I want, but I couldn’t find a way to make it work I intend, also not sure if its even for that.

Yes, you’ve stated this, and I responded.

So, what can you do?

One option is to manually reposition your character off of the lift by setting their location and rotation in the direction of the click (playing an animation walking/running montage with this function). And then once they have overlapped with the static navmesh, you can have it take over (probably with an overlap event).

And/Or

You can check these plugins out (they are free):

https://www.unrealengine.com/marketplace/en-US/product/customizable-pathfinding
https://www.unrealengine.com/marketplace/en-US/product/don-s-3d-pathfinding-flying-ai

(It may be too late for you to incorporate these. I don’t know. I haven’t used them, as I generally avoid plugins.)

1 Like

Yeah plugins aren’t my thing either and I’m too far in navigation to start again

the manual reposition suggestion could work, but that sounds like a lot of trouble for something otherwise simple. I’d also have to do the inverse for when I want to hop onto the platform, and AI wouldn’t be able to follow anyway.

I really think I’m missing something, I mean you can dynamically add barriers to the navmesh without refreshing it entirely all the time, it feels like dynamically adding connections shouldn’t be impossible

you can put a invisible mesh at the end of the elevator’s path.set it to ignore everything.but block one thing that doesn’t exist in your scene,for example block vehicle.the navmesh will generate on it.

it was @Ivan3z found the solution.at post 5

2 Likes

Brilliant! It worked perfectly. thank you, sir

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.