Newly generated MidPhases are copied into the array accessible in the NarrowPhase after the OnPreSimulate callback is invoked. As a result, it is not possible to modify newly created MidPhases within the OnPreSimulate callback.
(see FCollisionConstraintAllocator::ProcessNewItems and its callers)
Applying the following workaround allows VisitMidPhases to iterate over all MidPhases in callback.
template<typename TLambda> void VisitMidPhases(const TLambda& Visitor) { ProcessNewItems(); //add this call for (FParticlePairMidPhasePtr& MidPhase : ParticlePairMidPhases) { if (Visitor(*MidPhase) == ECollisionVisitorResult::Stop) { return; } } }
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-356363 in the post.
| 0 |
| Component | UE - Simulation - Core |
|---|---|
| Affects Versions | 5.6 |
| Created | Dec 2, 2025 |
|---|---|
| Updated | Dec 2, 2025 |