If something is executed before a SetActorRotation node on Tick inside of a SceneComponent class BP and then added to an Actor class BP, the physics will lag
User Description:
When using set rotation inside scene or actor component bp the target actor(with simulation on) physics is affected. Physics simulation like the gravity, or adding force seems to be stopped when the actor is rotating. Goes back after the rotation is finished.
Set rotation does work correctly when directly inside the actor bp. Also works properly when actor physics is off, while gravity is on.
1. Open the attached test project
2. Open the RotatorScene > Event Graph to see what is implemented
3. PIE
Results: The actor will start to fall but the fall will lag while it is rotating (no FPS drop). Once the rotation is complete, the actor will fall quickly.
Expected: For the actor to rotate correctly while it is falling. If the Print String inside of the RotatorScene is bypassed, the actor will rotate and fall correctly.
From scratch:
REPRO STEPS:
RESULT:
The actor will spin, but not fall, despite Simulate Physics being turned on. This is because, in the BP, in Class Defaults, the Tick Group (under Actor Tick > Advanced) is set to During Physics. If you change it to Pre or Post Physics, the bug no longer occurs. This is where the initial confusion came from with linking the problem to Scene Components - the Tick Group defaults to During Physics, whereas on a normal static mesh actor it defaults to Pre Physics - so the bug wasn't initially reproducible unless you had the Scene Component.
It's also important to note the issue still occurs if you remove the Print String node, but it is much less obvious - the actor drops, but there is a slight stutter. Unchecking Print to Log on the Print String node can also reduce the impact of the issue.
Original repro kept below for posterity:
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Simulation - Physics |
---|---|
Affects Versions | 4.13.1, 4.14 |
Target Fix | 4.15 |
Created | Oct 13, 2016 |
---|---|
Resolved | Nov 29, 2016 |
Updated | Apr 27, 2018 |