Godot Version
4.5
Question
I’m just learning Godot and using C# (I’ve worked in C# for a decade, so y’know), and I’m trying to understand Godot’s mental model. Right now, I’m trying to understand what a PackedScene represents, and how it differs from a Scene, and I think I’m misunderstanding Scenes and Nodes in general.
So I think a Scene is like a class definition for Nodes, because you can add instances of a Scene as a Node to other scenes. This implies I should be able to new() a Scene instance and get a handle to something I can add to the Scene tree… but that’s not true. If I want to dynamically add an instance of a Scene, I have to use:
MyPackedScene = ResourceLoader.Load<PackedScene>("res://scenes/my-scene.tscn");
MyScene sceneInstance = MyPackedScene.Instantiate<MyScene>();
…but I don’t know what the difference is between that and just calling:
MyScene sceneInstance = new MyScene();
Both allow me to AddChild(sceneInstance) without errors, but only the first actually does anything.
So my question is: what does a PackedScene represent, and how is that different from what a Scene class definition represents? Why is it that I can get an instance of MyScene using either approach, but they have different behaviors?
Thanks!

