Side Scroller Camera

So I’ve been trying to have a camera offset so when you move right the camera offsets 100 in Y then when you press left it offsets -100 in Y so the camera is always offset in front of the camera in the direction he is facing.

This works but the camera does not stop.

You should utilize lag on a camera spring arm:

scratch that…i see you want to offset IN FRONT of the player. would be cool if UE4 supported an inverse lag function on the spring arm. would be super simple to implement if you have code access…

Try this approach:

Using Sign node will produce -1, 0 or 1 output (even if the axis value is a fraction in either direction). Multiply it by the desired offset amount and use SetRelativeLocation instead of AddRelativeLocation to avoid continually stacking the offset.

Keep in mind this approach will center the camera if the event is producing axis value of 0, to avoid it you can add a simple If node at the beginning and check if the input is 0, if so, do nothing (hence maintain the last set location)

Thats great! it fixed the base problem it now jumps to a offset in the direction i’m moving but it jumps how could I make it more of a smoother transition

Read about using [Timelines][1].

Here’s a possible solution

Thanks that works great for me.

Thank you, phoboz, for that brilliant solution! :slight_smile: