0 votes

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.

asked Jul 13 in Engine by Socrates (547 points)

1 Answer

0 votes
Best answer

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.

answered Jul 13 by eons (6,916 points)
selected Jul 14 by Socrates

Works perfectly! Thank you!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.