Godot Version
Godot 4.5
Question
I am making a node to help with instancing my other nodes mainly my camera.
My Question is “Is this the right way, Otherwise what would be the right way, or Is there a better way to do this without making a headache for myself?” (Only really need an answer to one of these its hard to ask seemingly simple questions)
The whole reason I am doing this is to help with multiplayer and making the camera so I don’t have to Make each camera and UI separately. Instead I will just plop this into my scene perhaps assign a player and move on.
This is the node I am creating to instance my other nodes:
class_name PlayerMain
extends Node
const PlayerGUI = preload("res://Scenes/RigsAndTemplates/GUIAndViewport.tscn")
const PlayerCamera = preload("res://Scenes/RigsAndTemplates/PlayerCamera2d.tscn")
func Add_Packages():
var SpawnGUI = PlayerGUI.instantiate()
var SpawnCamera = PlayerCamera.instantiate()
add_child(SpawnGUI)
print(PlayerGUI.tranform)
PlayerGUI.add_child(SpawnCamera)
print(PlayerCamera.tranform)
I think this should work but it doesn’t and I get this error.
ERROR: Could not create child process: --version
OK to extrapolate on my problem.
This is my player scene and script (So far)
I am attempting to add this node to another node. (Without instancing it, explains why in a sec)
And I want it to have all its children, I was attempting to make it get its children as a work around but that seems to not be working. Is there a method to accomplish this without causing disruptions or experiencing errors?


