Ensure triggered with Instanced Static Mesh and Navigation cached bounds in 5.6.1

Hello,

Since we upgraded to 5.6.1, we started to have an ensure in FBoundsCacheElement::GetValue in one of our BP that creates navigation relevant buildings using ISM in our project.

```

const FBoxSphereBounds& GetValue(bool bCheckValid = true) const

{

ensure(!bCheckValid || bIsValid);

return Value;

}

```

In our Blueprint, we use the node AddInstance in a loop to add ISM to the ISMComponent in the Construction Script, which is causing the ensure to trigger.

I tried to integrate the changelists 43372254 and 44593725 that seemed related to this issue but without any luck.

I kept digging and I noticed two issues related to ISM and Navigation:

1. AddInstanceInternal doesn’t cache navigation bounds at the right moment causing the ensure

The callstack look like this:

[Image Removed]

When adding the first Instance (GetInstanceCount() == 1), AddInstanceInternal() calls FNavigationSystem::RegisterComponent(*this), which at some point calls Bounds = NavRelevantInterface->GetNavigationBounds(); in FNavigationElement::InitializeFromInterface. At this point, CalcAndCacheNavigationBounds(), which cache the navigation bounds, was never called since PartialNavigationUpdate() is called after FNavigationSystem::RegisterComponent(*this).

[Image Removed]

My fix is to call CalcAndCacheNavigationBounds() in the if (GetInstanceCount() == 1) scope. It seems to be an oversight since it is called in the AddInstancesInternal() method !

[Image Removed]

2. Calling SetCanEverAffectNavigation on ISMComponent that have the flag “CanEverAffectNavigation” turned off cause the ensure

The same ensure can be triggered when enabling Set Can Affect Navigation on a ISM with at least one instance, it goes through the navigation registration code for the ISM but CalcAndCacheNavigationBounds() was never called at the moment the system needs the bounds.

Here is the callstack:

[Image Removed]

and a minimal repro if you want to test it, add a Static Mesh in the ISMComponent and use this graph:

[Image Removed]

I don’t have a fix for this one since I could bypass this issue in our blueprint.

For point 1, is it a valid fix in your opinion ? For point 2 it was to letting you know in case you want to fix it.

Thanks a lot a have a good day,

Guillaume

Steps to Reproduce
See message

Hello [mention removed]​,

I tried reproducing the behavior on my side with both the UE 5.6.1 launcher version and a source build at the latest from the //UE5/Release-5.6.1 stream (CL 44394996), but I haven’t been able to trigger the ensure so far.

Would you be able to share a minimal repro project where the issue occurs?

Best,

Francisco

Hey Francisco,

For point 1., here is a project using UE 5.6.1 from the launcher with the repro.

Open ReproMap level containing the BP_NavMeshRepro blueprint and notice the ensure.

[Image Removed]For point 2., I noticed that the node “Set Can Affect Navigation” is a cutom node made by one of our programmer, so we’ll handle the case on our side.

Thanks and have a great day,

Guillaume

Hello [mention removed]​,

Thanks for sharing the repro project. I was able to reproduce this issue locally in both UE 5.6 and a recent internal build from the Main stream (CL 46622846) confirming that the issue is still present. I also tested the same setup in 5.5 where the problem does not occur.

I’ll go ahead and submit a bug report to the Epic team for further investigation and will include your proposed fix, which also works correctly in the Main stream.

I’ll follow up soon once the ticket has been created.

Best,

Francisco

Hey Francisco,

Good to hear :slight_smile: Our fix is still working but I’ll integrate the official one when it’s out.

Best,

Guillaume

Hello again [mention removed]​,

I’ve submitted the bug report for the Epic team to review. You will be able to track the status of the bug in the following link: Unreal Engine Issues and Bug Tracker (UE\-348073)

Please note that Epic decides which issues become publicly accessible and the process may take a few days. The tracking link might not work immediately.

I’ll go ahead and close the case now but feel free to reply if you have anything else to add.

Best,

Francisco