Hi, still learning Godot, I have a couple questions, thanks!

I am wondering if it is possible to read exported variables from a PackedScene without instancing it?

Or, a related question. Can I read exported variables for a scene that hasn't been added to the main scene yet (calling print_tree on root doesn't show the scene, but is in the scene inspector)?

Lastly, I thought I read somewhere that root can only have one child, but adding children to the root (in code) seems to work fine. Is there a problem with doing this?

TIA!

Josh

The actual root should be a viewport IIRC, and in editor at least, yeah, you can only add one child that would become your scenes root node, to that scene root you certainly should be able to add as many children as you can.

https://docs.godotengine.org/en/3.1/getting_started/step_by_step/scene_tree.html#id1

I'm not sure how you could read something from the PackedScene without loading it, and looking at the PackedScene class docs indicates that it very much is designed to be instantiated.

https://docs.godotengine.org/en/3.1/classes/class_packedscene.html

If you load the PackedScene without instantiating it, perhaps the _bundled property could be used to find and get something out of it though? I haven't really tried to do so though.

3 years later