How to Lock/Unlock Z-Axis of Sidescroller Camera

Hi all,

I’m working on a 2.5D side scroller game, and after reading a lot of helpful posts here on Answerhub, I finally have a camera setup that is working MOSTLY how I want.

In the picture below, the Spring Arm Offset Z (green section) is what currently locks the camera’s z-axis, allowing movement in only x and y. However, I also want to automatically raise the camera to match the character’s location when they jump to new heights. This is achieved well by the Camera Offset Z section, which uses an FInterpTo node to blend between the current and new world locations whenever the two positions deviate by 50 or more. This basically makes a nice “lazy cam” that drifts up and down with the character.

The problem is when the character
falls from a great height very quickly
or is on a fast moving elevator, the
camera won’t catch up quickly enough.
I’d like to dynamically increase the
Interp Speed of the FInterpTo node
whenever the character deviates by
more than 200 from camera’s position,
but unfortunately, raising the value
of Interp Speed to anything higher
than 1 results in horribly choppy
motion, and I’m not sure why.

How would you go about doing this? I’m sure there’s many ways to achieve this, but I’ve really been having a hard time figuring it out. I would love to hear your suggestions!

Thank you so much for any advice you can spare. :slight_smile:

-Adam

Click image link below to open larger version: