0 votes

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

There is a grid scene, which takes numberoftilesx and numberoftilesy 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.

enter image description here

Godot version 3.1 Stable Mono
in Engine by (18 points)

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

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.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.