0 votes

I'm using 2D. How do I programmatically move the default (root?) camera to a different position in my game world?

in Engine by (91 points)

1 Answer

+3 votes
Best answer

You don't. There is no default camera get_viewport().get_camera() == null
You can access viewports transformation e.g. get_viewport().global_canvas_transform = get_viewport().global_canvas_transform.translated(Vector2(100,0))
But I would avoid using that and just stick to using Camera2D nodes

by (1,022 points)
selected by
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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.