Physics Constraint Bug On Reload Level

I created a BP that contains a steel rack that rotates around the Y axis using a Physics Constraint. I then attach 8 white steel targets to the rack using physics constraints, so when the rack rotates, the targets rotate with it. The player can then shoot the targets, which breaks the target’s physics constraint and the targets fall off the rack. This works fine but I’ve had an issue with one or more targets/physics constraints freaking out when I reload the level. I use level streaming to load levels, so to reload a level I unload the level and when it’s completed unloading, I load it again. The targets only freak out when I reload the level.

[Video of Bug][1]

Were you able to resolve this issue?

I am facing the same problem in 4.19.2.

When unloading and then reloading a level via level streaming, the physics objects that are reloaded go nuts and fly everywhere if they’re already moving when the unload occurs. This is strange because I am waiting for the unload to complete (all the physics actors are destroyed) before I begin to load again.

I was looking for a way to reset all physics before loading to possibly solve this, but I couldn’t find an obvious way of doing so.

The only way I was able to fix this bug was to not setup the physics constraints On Begin Play. I had created a blutility that would spawn however many Steel Targets I wanted, and then On Begin Play I would constrain those steel targets to a Physics Constraint. So my solution was to manually add however many Steel Targets(Static Mesh Components) to the blueprint (So I did away with the blutility), and then setup the Physics Constraints within the blueprint editor instead of during runtime. I think trying to setup the Physics Constraints during runtime was the source of the problem.

Thanks for the response!

In my case, I’m not using constraints. Rather, this is occurring after applying impulse to or fracturing Apex destructibles and immediately reloading via level streaming. I’m actually not sure now whether this is an issue with physics in general or just with Apex, so I’m going to look into this some more and maybe submit a separate ticket.

Edit: After some experimentation, I found a way to solve the problem (probably not addressing the root of the problem, but it seems to work)

  • Conditions: This occurs on Apex destructible actors, but only when “Simulate Physics” is set to true.

  • Solution: Immediately before calling UnloadStreamLevel(), loop through all ADestructibleActors and explicitly call Destroy() on each one of them. This seems to successfully destroy the physics state or whatever lingering information is causing them to go crazy after reloading.