Limit Camera Lag to Z-Axis?

Praise God – problem is solved and it was even easier than I thought! Thanks to @Everynone for this fantastic solution as shown HERE.

There’s no need to spawn another camera, simply attach a camera to your spring arm as normal, then set the spring arm to use “Absolute Location”.

EDIT (10-13-2022): While you can technically do this under its “Transform Details” (by clicking the little arrow next to “Location” and choosing “World” for its “Location Type”, this can potentially cause some problems when trying to position your character in the Editor (since the spring arm and camera will stay put while the character is moved around). Also, when playing in a Standalone Game with a landscape, the camera will visually slide up into position, rather than starting where you want it to. To avoid these problems, we will set the Absolute initial location of the Spring Arm on Begin Play.

So from Begin Play, get a reference to the Spring Arm and add a “Set Absolute” node. Tick the box for “New Absolute Location”. Now add a “Set World Location” node. Next add a “Get Actor Location” node, then a “Break Vector” node, and make a Float Variable called “Spring Arm Z-Offset”, which will then be added to the Z value. This variable controls how high the spring arm will stay above the center of your character’s capsule. I used 40 for my character. Plug all this into a Make Vector node and connect to the “New Location” input on the “Set World Location” node as shown below:

Now, create a Custom Event (or Function) called “Camera Lag”, and set it up as shown below. This will smoothly blend between the world location of your spring arm and the Actor Location (your character’s root or capsule). Call this Custom Event on Tick and you will now have smooth camera lag in the Z-Axis only! :smiley:

9 Likes