The root of the problem occurs in Step 6. ARecastNavMesh::OnNavMeshGenerationFinished() gets called, and gets to the line:
Level->NavDataChunks.Add(NavDataChunk);From now on, every time you add this level as a level instance, whatever is in NavDataChunks is going to show up because of ARecastNavMesh::OnStreamingLevelAdded, where it reads the NavDataChunks and attaches them.
The data saved in there is not spatially localized to the level instance level you are working in, but rather to the persistent level said level instance was in when you did Build Paths.
For my particular project case, I am able to work around this because I don’t actually want the level instances to bring in their own navmesh data. I do Build Paths in the persistent level. I am not using World Partition.
My first workaround approach was simply to delete the data out of NavDataChunks, which I did by opening the corrupted level and changing the Navigation System Config in the World Settings to the Null Nav Sys Config, which would call DiscardNavigationDataChunks from AddNavigationSystemToWorld.
But this wasn’t a good solution, because even though the level had a Null Nav Sys Config, the same repro steps above will still end up adding data to the level. So you tediously have to clear out the NavDataChunks again.
Of course, I could also simply delete the NavMeshBoundsVolume in the level, which would prevent ARecastNavMesh::OnNavMeshGenerationFinished() from adding to NavDataChunks.
But I would prefer the NavMeshBoundsVolume to stay, because it is valuable when the level is being edited (just by itself, not as a level instance) to be able to build navmesh data and view it. It’s just I don’t want that navmesh data to come in anytime I use the level as a level instance.
So for my case, I am going to add a new field to the RecastNavmesh class: bSupportsStreaming
This will get read in SupportsStreaming() and if false, make the function return false, thus preventing any data from streaming level instances from being brought into the persistent level. I will set this new flag to false on the RecastNavmesh in the persistent level.
But seems like there is a bug here in general.
[Attachment Removed]