+1 vote

EDIT: The camera wasn't moving because the viewport wasn't. I'm having problems with the viewport not moving with the model, not the camera

EDIT 2: Found out that I can move the camera out of the viewport node and have the screen work in-scene, but not once the scene is an instance in another. The screen stops displaying all together

I am working on a game, and I'm trying to make a screen display the image from a camera. The camera, screen, and the model are in a scene of their own (link to node tree image). The camera is not moving, however, even though it is a child of the model. Is there a way to set make it stay with the model?

Here's a screen shot of the problem, the camera look find here (Snowman is part of the main node)


But once it's moved over the camera stays in the same spot

And here's the node tree

in Engine by (16 points)
edited by

What's the Viewport for if there's nothing but a Camera?

1 Answer

+2 votes
Best answer

The camera is not moving because when a Spatial node is not child of another Spatial, it considers to be in global coordinates, even if there are spatial nodes further up the tree. This is especially relevant with Viewport because these can be used to simulate independent worlds from the one the viewport is child of.

You should probably assign your camera's transform by script to reflect the position you want, or use the RemoteTransform node: https://docs.godotengine.org/en/3.1/classes/class_remotetransform.html

by (27,603 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.