Runtime Navmesh Generation not Working?

Hey guys,

I’ve set “Runtime Generation” to Dynamic and the “Force Rebuild on runtime” is also checked. But the navmesh doesn’t update during runtime when I change the mesh of an actor.

If I restart PIE then the navmesh is generated properly as expected.

I’ve also tried the execute console command “RebuildNavigation” in my BP, but this doesn’t work.

How can I fix this?

Thanks.

Can Anyone help me with this?

I’mt pretty sure runtime mesh changes won’t rebuild navmesh. Forcing rebuild won’t help neither, because navigation system simply doesn’t know anything about the change. I suggest changing the mesh differently, like adding new static mesh component, or spawning new actor altogether.

Cheers,

–mieszko

Hey mieszko, thanks for replying.

I’m changing the current mesh by set static mesh. You are saying that it won’t get recognised by the navmesh as a change? Is that correct?

My actor contains a lot of components, so spawning the entire actor just to change a single component doesn’t seem right to me. I’ll do it if there isn’t any other solution.

Can you suggest any other solution to this?

I’ve also tried setting the collision after changing the mesh.

Thanks

I have nothing to help you with but im having the exact same problem. I want to spawn meshes that you can walk on after the game has started and the nav mesh just wont build. Ill let you know if i come up with anything. If nothing else perhaps this will bring attention to the issue.

Hey CodyScrib,

I’ve finally got it to work. As @mieszko suggested in his answer, Navigation mesh only detects change in the world if you spawn a new object or actor into the world.

So, I just went ahead and did that and it works perfectly.

Create a static mesh actor and spawn that at runtime. Or you can create a static mesh actor variable and assign the static mesh to it after spawn.

It worked for me. Hope it also does for you.

Thanks.

Ok @mieszko. I went ahead and spawned the required static mesh actor as you suggested and it works.

But, It would’ve been great if changing the mesh is detected by the Navmesh instead of spawning it. Just Saying.

But thanks anyways.
Cheers.

Thanks for the reply! i changed my meshes from instanced to just the regular old static and it still doesnt build to the spawned meshes. I have the Runtime generation set to dynamic, is there anything else you changed. any other setting i could be missing?

have you checked the Force Rebuild on runtime option. And also check the collision on your mesh.

Yep Force Rebuild is checked. I assume the collision is correct. If i through the mesh in just regular from the Content Browser in to the Level then it builds nav to it but if its spawned in it doesnt build however I noticed that it does rebuild in some small areas occasionally. So it is building during runtime. Just not to the spawned meshes

Actually navigation just stops building when I simulate

Yeah, it would, I know. We’ll get around to fixing it at some point, I promise.