Applying different rotation lag to each axis of a spring arm

This is a simple way to add different amounts of rotation lag to the different axes of a spring arm. Just check the order that the rotators are combined (added), because with rotators it does matter. I found the order of ‘roll + pitch + yaw’ works fine:

To smooth it further, overall, you can also turn on rotation lag in the spring arm.

I’ll just add that the Camera Manager provides an override for the camera behaviour. So this script could probably live there:

Especially handy if you have many cameras. Camera Target is the player controller’s current View Target; have the interface return pertinent data and one can handle all kind of behaviours in a single dedicated BP without cluttering pawns’ script.

2 Likes

@Everynone I hadn’t thought of this, so useful!

Here’s an updated version, with a little more explanation.

image

The obvious, common-sense choice of using ‘Get Actor Rotation’, will give you a hitch going beyond 90 degrees in pitch. It’s not a bug, it’s actually useful to have several format options… as long as people are aware of them… described in link below:

The 3 rotation formats in Blueprints - 1) Get Actor Rotation 2) Control Rotation 3) Normalized Rotation - Programming & Scripting / Blueprint - Epic Developer Community Forums (unrealengine.com)

Forgot to mention Base Aim Rotation which is what the server uses. If you want client and server traces to hit really close and use the cameras replication location you have to use Base Aim Rotation and Camera Manager → Camera Location.

Without using these two you can get the following. Camera is attached to head bone. (server is purple trace)

image

With Base aim and Cam mang location

1 Like