Hello,
We have rock actors with HISM components, which can be loaded and unloaded by World Partition. When we teleport to a certain location, the WP loads that part of the level containing the rocks, but the navmesh is not updated — even though the rocks have proper collision and CanEverAffectNavigation set. With navmesh preview enabled in the editor (while the game is not running), the rocks correctly affect navigation (the problem occurs only during gameplay), so it seems that the issue arises when loading actors with HISM components (during PIE or playing on standalone build).
As far as I’ve investigated, the HISM component tries to update the navmesh before it’s registered in the navigation system:
1) AActor::IncrementalRegisterComponents is called. At this point, the actor is not yet registered with the navigation system (it will be registered in PostRegisterAllComponents).
2) UInstancedStaticMeshComponent::OnRegister is called for each HISM component of the rock actor. From here, UPrimitiveComponent::OnRegister() is also called, which attempts to register the component with the navigation system (FNavigationSystem::OnComponentRegistered(*this)). However, due to the following lines in UNavigationSystemV1::RegisterComponentToNavOctree, the registration is skipped:
if (UE::Navigation::Private::ShouldComponentWaitForActorToRegister(Comp))
{
return;
}
By default, ShouldComponentWaitForActorToRegister returns true, so the component is not registered at this point.
3) At the end of UInstancedStaticMeshComponent::OnRegister, PartialNavigateUpdateForCurrentInstances() is called. However, since neither the actor nor its components are registered yet, the navmesh ignores their collision.
4) When AActor::IncrementalRegisterComponents finishes, the actor calls PostRegisterAllComponents and finally registers itself and its components to the navigation system. But because HISM components support partial navigation updates, adding them to the navigation system at this stage doesn’t trigger a navmesh update.
So my question is:
Should PartialNavigateUpdateForCurrentInstances() be called later — after the components are registered in the navigation system (which would make this an Unreal Engine issue)? Or could this problem be caused by our HISM setup or configuration?