Navmesh not rebuilding at runtime

G’day

So I have created a custom Actor and am using this to spawn static mesh components dynamically into the world at runtime - problem being the newly spawn components are not being added to the navmesh.

If I move the nav bounds volume slightly I get the “Building Navigation” window pops up and the count does not decrement, the popup does not go away until I stop the stop the game in editor. I have Rebuild Navigation selected in all of the appropriate places and have trawled this forum and tried all of the suggestions. I am using 4.6.

Is there a trick when spawning the components to have them included in the default navmesh? Or having the navmesh actually complete rebuilding at runtime? Weirdly if I follow the same process using just Blueprints the navmesh seems build fine…

Also I noticed both bRebuildAtRuntime=True and bRebuildAtRuntime=false (note the lowercase F) gets appended to the Navigation System ini settings occassionally…

Any help appreciated!

When spawning StaticMeshComponents where do you attach them, what actor owns them? Make sure that actor you’re using for this is navigation relevant (CanEverAffectNavigation set to true) otherwise it will just get ignored by navigation generation.

Navmesh generation count not going down after moving a navmesh bounds volume is a result of some details of editor-level BPS handling which in turn results in navmesh generation being triggered for editor-time world (rather then PIE world) and is pause until PIE finishes. A kind of a bug, I know, but you should not be messing around with BSPs at runtime anyway, so it’s a bit low priority.

Also I noticed both bRebuildAtRuntime=True and bRebuildAtRuntime=false (note the lowercase F) gets appended to the Navigation System ini settings occassionally…

Sounds like a bug. Kindof :slight_smile: bRebuildAtRuntime is ANavigationData’s property - does it get appended to Engine.NavigationSystem’s settings?

Cheers,

–mieszko

Absolutely correct - the problem in my case was that the owner wasn’t being properly set on the spawned components. Thanks!