Quick answer: Pass both bMarkRenderStateDirty = true and bTeleport = true to UpdateInstanceTransform. Without them, the render state may update but the physics body keeps the old transform. For batches of moves, prefer BatchUpdateInstancesTransforms.
Here is how to fix Unreal InstancedStaticMesh collisions that diverge from the visible mesh after instance transforms change. The visual is in the new place; physics queries still hit the old place. The fix is the right flags on the update call.
The Symptom
Move an instance via UpdateInstanceTransform. Visually it moved. Click on it: the line trace hits empty space where it used to be. Collision lags the visual.
What Causes This
Default flags do not refresh physics. bMarkRenderStateDirty defaults to false; physics body is not rebuilt unless explicitly requested.
Teleport flag missing. Without bTeleport, physics treats the move as a continuous transition; can produce wrong intermediate states.
Per-instance updates without batch. Calling Update once per instance for thousands of instances is expensive; physics rebuild for each is wasteful.
The Fix
Step 1: Call with correct flags.
FTransform NewTransform(/* ... */);
ISM->UpdateInstanceTransform(InstanceIndex, NewTransform,
/*bWorldSpace*/ true,
/*bMarkRenderStateDirty*/ true,
/*bTeleport*/ true);
Step 2: For batches, use BatchUpdateInstancesTransforms.
TArray<FTransform> NewTransforms;
// fill array
ISM->BatchUpdateInstancesTransforms(0, NewTransforms,
/*bWorldSpace*/ true,
/*bMarkRenderStateDirty*/ true,
/*bTeleport*/ true);
Single GPU buffer upload, single physics rebuild for the affected range.
Step 3: Force MarkRenderStateDirty for visibility.
ISM->MarkRenderStateDirty();
Useful after manipulating instance properties like CustomData per-instance.
Step 4: Recreate physics if needed.
ISM->ReleasePhysicsState();
ISM->RecreatePhysicsState();
Heavy-handed but reliably refreshes all instance bodies.
Step 5: For HISM, the same flags apply. HierarchicalInstancedStaticMeshComponent inherits ISM’s API. Use the same calls.
“Visual update needs MarkRenderStateDirty. Physics needs Teleport. Set both, every move.”
Related Issues
For static batching equivalent, see Static Batching Runtime. For physics constraint after load, see Physics Constraint After Load.
bMarkRenderStateDirty + bTeleport. Batch where possible. Collisions track visuals.