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 3 days ago in Engine by Socrates (495 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 3 days ago by eons (6,272 points)
selected 2 days ago 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.