How to select all children of a node at once ? Through Code So, that I can change their property ..
How to select all children of a node at once ?
@ari484 said: How to select all children of a node at once ? Through Code
Technically you cannot select all of a node's children at once, at least not through code. You can do something like this though:
var children_nodes = node_name_here.get_children()
for child in children_nodes:
"Change whatever property you want here!"
child.name = "Example"
Depending on which nodes you have and what properties you want to change, you may need to add additional checks. For example, this snippet changes the text for Label
nodes and renames every other type of node:
var children_nodes = node_name_here.get_children()
for child in children_nodes:
if child is Label:
child.text = "Label Node"
else:
child.name = "Not A Label Node"
4 years later
Megalomaniak added the Godot Help tag .