Is it possible to make a viewport node move with it's parent?

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

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

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

Dlean Jeans | 2019-07-04 00:44

:bust_in_silhouette: Reply From: Zylann

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: RemoteTransform — Godot Engine (3.1) documentation in English