Trying to make a loop in which I use a for loop to create nodes. To ensure the nodes are being created properly, I try to spawn meshes to track their position. However, when running it, I only see a single mesh at the last position, instead of a cube at each node position, regardless of how many nodes I make when I call GenerateGraph.
You are always using the same node by calling “$MapNode”. This means you will always get the first child when calling get_child(0). You would need to call get_child(i).
Also you are always adding the same node to the Nodes array, because of the previous mentioned mistake
Click and drag your MapNode scene file (probably calledmap_node.tscnif you followed the recommended guidelines) from your FileSystem into your code. Right before letting go, hold down Ctrl and then let go of the mouse button. (That’ll create a const line.)
Add the following code where you had var newNode = $MapNode