So I have a ton of text boxes in my code. To call them, I reference a variable that contains “$node_path”. Which works perfectly fine. I called the variables I1, I2, I3, etc.
I am trying to create a loop that calls the same function in every node. Instead of calling every variable separately, can I create a new variable that combines “I” and the step of the loop and call a function in it, as if I was calling the node? If so, how?
I’ve tried
for i in range(1, 70):
var Item = str(“I”, i)
Item.function()
But it doesn’t work
I would have believed that the Nodes are all named in a specific incrementing way and all children have the same parent node.
for i in range(1, 70):
var element = get_node("PATH/TO/node" + str(i))
if not element: return
if element.has_method("someFunction"):
element.someFunction()