Just a heads up:
During the course of implementing solution for the advanced tank sample, I became aware that the transform of the turret’s physics bodies was not being updated.
(During PIE, hit “~” and type “pxvis collision” and then rotate the turret (or thing you are rotating.) You’ll see the pink physics volume isn’t animating along with the mesh.)
Instead of driving the turret via the anim blueprint, our resident physic expert suggested using torque. will keep everything within the physics system and update collisions accordingly.
After a good deal of tuning, the turret controls now look like :
The first half of the graph handles the initial rotation update of the turret. It applies a torque force to the turret bone based on the difference between the camera direction and the turret orientation, multiplied by a tuning factor.
The second part generates a counter force to slow the turret to a stop once the initial torque has been applied.
There’s some PhAT tuning of the turret’s mass going on to make it look nice, but that’s the gist of it.
NOTE: is 4.8, which added the “Accel Change” parameter that simplifies all tremendously.