Instance a Scene and modify a children of the scene root node

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

TL DR: How do I access a child node of an instanced scene?

There is a grid scene, which takes number_of_tiles_x and number_of_tiles_y as exported variables. They decide how many cells will be spawned and can be edited via the inspector.

There is a level scene, which has a grid, TextureButtons, sounds. And of script with a lot of other scripts for AI, pathfinding etc.

So far, so good. To create a mission, I would like to instance the level scene, adjust the grid size and maybe the music and buttons. The units are spawned via C# code, so this is not a problem.

When I create a new scene and instance a level in it, how do I decide which parameters are given to the child nodes of level? I can change the variables of the instanced level node, but not of its child nodes like TextureButton or the gridsize.

Have you tried looking for a specific node via the find_node() method, and then tried editing the properties of the returned node?

Ertain | 2021-02-23 00:33

I think right click on level and click on editable children may do the trick. Have to try it out. I want it to work in the editor / inspector.

rohezal | 2021-02-23 00:35