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.