Description

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;
					}
				}
			}
Steps to Reproduce
  1. Download the reproduction project from the EPS case.
    *n this project, CCD for rigid bodies that come into contact with the vehicle is disabled inside TSimCallbackObject::OnPreSimulate_Internal.
    This is because when CCD is enabled, the vehicle's speed drops significantly upon contact with a rigid body, regardless of its mass.
  2. Launch the project and start PIE.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-356363 in the post.

0
Login to Vote

Unresolved
ComponentUE - Simulation - Core
Affects Versions5.6
CreatedDec 2, 2025
UpdatedDec 2, 2025
View Jira Issue