Problem: I can toggle physics simulation on a static mesh component on and off and it works until I try to add force or torque through an actor component. I can turn it on once but if I turn it off, it doesn’t simulate anymore even though IsSimulatingPhysics is returning true. The same behaviour occurs for components made in Bluprint and in C++.
Below, a basic Blueprint ActorComponent that reproduces the bug when applied to a Blueprint with a StaticMeshComponent. If I disconnect the AddForce from Event Tick, the Physics Simulation works just fine. On and Off. But, trying to add force or torque, it turns on once and, if I turn it off, it won’t simulate again.
I duplicated your setup and unless I’m misunderstanding, it is working on my end. I used a Blueprint Actor Component and a Mesh Component variable. The only difference is I used a larger amount of upwards Force.
At first I thought I was crazy or my engine was broken somehow because you did exactly the same setup as mine. The low force in mine made it float because I’ve lowered the mesh physical mass.
After fiddling with all the default physics setings that I suppose your mesh was using, I found the problem in an option I set on the project: Substepping to true (not the default).
By turning off substepping it worked, just like yours. So, I believe it’s a bug with the substepping system. Could you try to reproduce it? I know it’s an experimental feature and, for now, I’ll try to work without it. But it was helping a lot in my project’s quality.
I see exactly what you mean now. It’s seems to only happen while all three of these things are happening:
Substepping is Enabled
An Actor Component is driving the blueprint
Click Events are used to toggle physics
I’ve entered it as JIRA UE-14634 in our tracking software and our developers will be investigating the issue further. We will post back here with updates as we have them.
TJ, after some more testing I discovered you can remove the third condition from your list. It doesn’t have to be toggled by click events. Even from a Timer or DoOnce with delay etc… it stops simulating physics forever.