How do you make a Camera2D that only follows its parent on the x-axis?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Socrates

How would i set up a Camera2D that only follows its parent on the x-axis? I’ve tried setting it’s position.y every frame but it still moves up and down on the y-axis slightly, whenever the parent node does.

:bust_in_silhouette: Reply From: eons

One option is to restrict the camera to a pixel of motion on Y.

limit_top and limit_bottom are the properties for translation constraints.


Another way is to separate the camera from the target, put a RemoteTransform2D on the target, restricted to X, and link the camera to the RemoteTransform2D.

Works perfectly! Thank you!

Socrates | 2018-07-14 04:45