class_name Main extends Node3D @onready var noise := FastNoiseLite.new() var chunks := [] func _ready() -> void: brrr() class OtherThread extends Thread: func _exit_tree(): wait_to_finish() func brrr(): noise.seed = randi() var thread = OtherThread.new() var rrrb = func(): for row in range(0, 8): chunks.append([]) for column in range(0, 4): chunks[row].append([]) for depth in range(0, 8): chunks[row][column].append([]) var chunk = Chunk.new() chunk.noise = noise var mesh = chunk.generate_chunk(row, column, depth) add_child.call_deferred(mesh) chunks[row][column][depth] = chunk thread.start(rrrb) #thread.wait_to_finish()