If the level has hidden sublevels, the regenerated navmesh result appears to have a hidden sublevel mesh placed at the origin.
Apparently, the reason is that bNavigationRelevant is no longer considered when exporting the mesh since 4.24.
The following workaround worked
void FNavigationDataHandler::UpdateActorAndComponentsInNavOctree(AActor& Actor) { INavRelevantInterface* NavElement = Cast<INavRelevantInterface>(&Actor); if (NavElement) { UpdateNavOctreeElement(Actor, *NavElement, FNavigationOctreeController::OctreeUpdate_Default); } for (UActorComponent* Component : Actor.GetComponents()) { INavRelevantInterface* CompNavElement = Cast<INavRelevantInterface>(Component); if (CompNavElement) { // Component != null is implied by successful INavRelevantInterface cast if (Actor.IsComponentRelevantForNavigation(Component) && Component->bNavigationRelevant ) //this line { UpdateNavOctreeElement(*Component, *CompNavElement, FNavigationOctreeController::OctreeUpdate_Default); } else { UnregisterNavOctreeElement(*Component, *CompNavElement, FNavigationOctreeController::OctreeUpdate_Default); } } }
Result:
Incorrect navmesh is displayed in center of the level (0.0, 0.0, 0.0 ).
please see screenshots below.
1. opend level (sublevel is hidden)
[Image Removed]
2.moved a mesh and an incorrect navmesh is regenerated
[Image Removed]
3. once the sublevel will be visible
[Image Removed]
4. If hiding the sublevels again, the navmesh stays normal .
[Image Removed]
How does TextureRenderTarget2D get TArray<uint8> type data?
How do I set a material as a post-processing material?
How to delete some elements correctly when deleting an array loop?
Why does the REMOVE method of map container remove elements have memory leaks?
UMG RichText not appear image when packaged
What is the cause of the packaging error falling back to 'GameUserSettings' in ue5?
What is the difference between Camera and CineCamera?
How to implement springarm components to scale according to mouse position in spawn?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-102671 in the post.
6 |
Component | UE - AI - Navigation |
---|---|
Affects Versions | 4.24, 4.25, 4.26 |
Created | Nov 6, 2020 |
---|---|
Resolved | Jul 19, 2022 |
Updated | Jul 19, 2022 |