bStartAwake = false ignored on child levels

Problematic Scenario

LevelA has a simulated actor called CubeA with bStartAwake = false. LevelB has a simulated actor called CubeB with bStartAwake = false. LevelB is automatically loaded by LevelA, making both cubes visible. CubeA stays asleep, CubeB falls.

Probable Cause

Looking around the code, it seems that a body with !bStartAwake calls RigidActor->setWakeCounter(0) such that it sleeps as soon as possible. However, when loading a child level, while ensuring its collision tree is built, all bodies that were not already sleeping (and CubeB is effectively not) are awakened, causing !bStartAwake to be ignored.

Possible Solution

Calling putToSleep() right after setWakeCounter() seems to fix this for me. Line 4898 in BodyInstance.cpp.

Hey lucasncv-

Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here Unreal Engine Issues and Bug Tracker (UE-36683) . You can track the report’s status as the issue is reviewed by our development staff.

Cheers