Can’t for the life of me figure this one out. I’ve made an array called grid.
var grid:Array
No Issues. Then I use get_children to populate that array from the node running this whole script.
grid.fill(null)
for i in self.get_children():
grid[#calculated_index] = i
I can print(grid) and it will give me Node references, but not the names corresponding to the hierarchy. It also won’t let me affect the nodes from the grid e.g.
grid[0].position.y += 5
Does nothing. I could easily do this in unity, but I’m trying to switch to Godot. Liking a lot of it, but this is so frustrating. Any help is appreciated.
oh yeah, grid.append(i) first
either you fill the grid array with zeros first so then to access it like grid[#calculated_index] = i
or append like that
I am filling null before. I edited the original post to show. I can’t really append though because I need it at a specific index. I’ve tried insert and this current = method. Same results.
The problem persists though that using grid[0].position or .anything
still produces no results
I can do that, but if I do something like node.name = 'garbage'
then print again. The node shows garbage as the name but it hasnt changed the name of the node in the hierarchy.
Seems like a reference issue. How can I get the children of a node into an array that I can use to later access those nodes and affect them?