Tiling not working

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Team445

I’m trying to tile a tilemap using GDScript. A function runs on the main scene.
I can’t figure out why the tiles don’t appear when the scene runs. Any suggestions?

func _generateGroundFloor():
groundFloor.clear()
var x = 0
var y = 0
for x in range(0, 1024, 16):
	for y in range(0, 608, 16):
		groundFloor.set_cell(x, y, 1)
		print("(", x , ", ", y, ")")
		
:bust_in_silhouette: Reply From: kidscancode

set_cell() uses map coordinates, not pixel coordinates, so you’re only setting every 16th tile.

for x in range(0, 64):
    for y in range(0, 38)

Also, you don’t need to declare loop variables.

Thanks. I was watching your videos on procedural generation.

Team445 | 2019-07-08 20:25