Godot Version
V 4.6.1
Question
I tried to use a for loop to place boxes in a row, with the same y axis but the code always places the boxes in the last loop (in the location the last box should be in)
extends Node
var coord := Vector2(20, 300)
var box_scene = preload("res://scenes/box.tscn")
func _ready() -> void:
var box = box_scene.instantiate()
for i in 5:
coord.x += 100
add_child(box)
box.position = coord