[Bug] Enabling physics simulation during gameplay doesn't prevent overlapping bodies

I have a very simple setup (demo project attached).

A “Block” BP that is based on Actor and has two components. A BoxComponent as root and a StaticMeshComponent as child. The Mesh has NoCollision while the Box is a PhysicsActor. None of them have SimulatePhysics enabled initially.

I place two instances of this BP in my level. One precisely on the ground, the second precisely on top of the first.

In my Character, I implement a custom input action (bound to Tab) that iterates over all instances and sets SimulatePhysics to true on the BoxComponents. I would expect nothing to happen. Instead, the upper box falls through and into the first one.

This only happens if the second block either overlaps the first or is placed precisely on top of it, while editing the level. If the second box is slightly above the first with no overlap, they behave as expected (the second falls onto the first and is blocked/stopped by it).

This only seems to happen if SimulatePhysics is enabled via an input action. It doesn’t happen if it’s enabled in BeginPlay or at design time.

Here are some further experiments:

The first three stacks on the left behave as I described above.
The three stacks in the middle use NoCollision for the BoxComponents and PhysicsActor for the MeshComponents.
The last three stacks use PhysicsActor for both components.
SimulatePhysics is set to false on all boxes.

I start the game, hit Tab to run the input action (enable physics on the components that are PhysicsActors) and this is the result:

Overlapping or touching boxes don’t block each other in the two configurations on the left. Only the boxes that had a small gap behave correctly. I would expect all configurations to behave as the last three stacks (no overlapping blocks, initially overlapping blocks are pushed apart). And this is what actually happens, if SimulatePhysics is enabled in BeginPlay, instead of an input action (ignore the OFF in this one):

Here is a short video:

And the demo project:

Hello Bajee,

Thank you for the very detailed description and the demo project. I see what you’re saying and I’ve reported the bug in our database. For your reference, the bug number is UE-21314. I’ll be sure to let you know when any progress has been made on this issue and if I need to ask any more information.

Have a nice day!

I’ve also encountered this bug in UE 4.10.4. It happens often as a box will typically rest on top of another box due to gravity. I’ve tried this with a Static Mesh Actor (a cube primitive) as well as an Actor with Box Collider as root and Static Mesh Actor as child.

The solution I’ve come up with is to use linear and angular velocity dampening instead of pausing physics simulation. Although this does allow for some movement, I expect to control it by increasing dampening.

This is marked “Won’t Fix: Not much interest and the fix would be too involved to be done any time soon.” See Unreal Engine Issues and Bug Tracker (UE-21314)