UE 5.6.1 Editor Crashes with ensure at InstancedStaticMeshComponent.h:128 during AddInstance in VS Debug Mode

Hi everyone,

I am a beginner developer currently learning Unreal Engine 5 with the help of AI. I’ve encountered a persistent issue that only occurs when running the Unreal Editor (version 5.6.1) through Visual Studio (F5 Debugging).

Problem Description: Whenever I attempt to add instances to an UInstancedStaticMeshComponent, the editor immediately triggers a breakpoint and halts in Visual Studio. This happens both in the Construction Script and during BeginPlay.

Error Log: LogOutputDevice: Error: Ensure condition failed: !bCheckValid || bIsValid [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Classes\Components\InstancedStaticMeshComponent.h] [Line: 128]

Context:

  • I am trying to generate a 24x24 hexagonal grid (576 instances) using Blueprints.
  • The hexagonal mesh was created using the built-in Modeling Mode tools in UE.
  • As shown in the attached image, the moment the AddInstance node (with the target connected to my Instanced Static Mesh Component) is executed, the crash occurs.

Crucially, if I launch the project directly from the .uproject file (without the VS debugger), the grid generates perfectly, and there are no crashes or errors.

It seems like the VS Debugger is sensitive to a race condition or an initialization state in the rendering proxy that I don’t fully understand. Has anyone else encountered this Line 128 ensure in UE 5.6.1? Is there a recommended way to eliminate this conflict or a specific setup I should use to avoid this while debugging?

I would truly appreciate any help or guidance!