How can i add a new root node to an existing scene tree?

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

I hat a first person player scene, that was a 3D-camera as the root node and a MeshInszance-sphere around it to show the position on the little map on the hud.
Now i want to show the view of this camera on a sprite on the 2D-Scene.
for this the camera must be in a ViewPort.
So i decided to restructure the player.
I want a Spatial as root, the ViewPort inside and the Camera in the ViewPort and the sphere under the ViewPort in the tree.

I tried to start a new scene as normal 3D-scene, that starts with a Spatiel.
than add a Viewport and copy and past camera ans sphere from the old player.
But trying to save this back into the player´s scene-file gives Circular reference errors.

How can i get my already correct setted camera into such a new scene-tree setul without theese errors?

:bust_in_silhouette: Reply From: Inces

You can right click on scene tree and there should be an option “create new root”
You can right click camera and save branch as a scene, then open new scene with new root and add branched scene as a child to it

never mind,
I was able to fix the broken scene by fixing things in the TSCN-file with the text editor.
I also had saved the script-code for the controls in a gd-file.

So i added the script into the new spatial root and the camera itself, that was back on default settings, needet just two changes in it´s settingst to be back, as i needet.
The gd-code from the old camera works in a spatial root as well as before in the camera.

Now i can head on finding a way to wiew the player-camera on the sprite, that acts as screen on the 2d-scene.

Drachenbauer | 2022-03-24 22:02