Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func _load_chunk(pos: Vector3) -> void:
- pos *= 25
- print("Trying to load at" + str(pos))
- print(!LoadedChunks.has(pos))
- if !LoadedChunks.has(pos):
- print("Loading Chunk at" + str(pos))
- var NewChunk = ChunkInst.instantiate()
- NewChunk.position = pos
- NewChunk.name = Globals.vector3_to_str(pos)
- LoadedChunks.append(pos)
- var all_vectors = Globals.get_vector3_square(25, 25)
- var StaticTile: PackedScene = preload("res://Assets/Enviroment/TilingSystem/TileFabs/StaticTile.tscn")
- for vector in all_vectors:
- # pass
- var NewTile = StaticTile.instantiate()
- print(NewTile)
- NewTile.position = vector
- NewChunk.add_child(NewTile)
- ChunkCont.call_deferred("add_child", NewChunk)
- # _debug_add(ChunkCont, NewChunk)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement