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.
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.
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.
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.
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.
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?
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