Advertisement
Guest User

Untitled

a guest
Jul 7th, 2024
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func _load_chunk(pos: Vector3) -> void:
  2.     pos *= 25
  3.  
  4.     print("Trying to load at" + str(pos))
  5.     print(!LoadedChunks.has(pos))
  6.  
  7.     if !LoadedChunks.has(pos):
  8.         print("Loading Chunk at" + str(pos))
  9.         var NewChunk = ChunkInst.instantiate()
  10.  
  11.         NewChunk.position = pos
  12.         NewChunk.name = Globals.vector3_to_str(pos)
  13.         LoadedChunks.append(pos)
  14.  
  15.         var all_vectors = Globals.get_vector3_square(25, 25)
  16.  
  17.         var StaticTile: PackedScene = preload("res://Assets/Enviroment/TilingSystem/TileFabs/StaticTile.tscn")
  18.         for vector in all_vectors:
  19.             # pass
  20.             var NewTile = StaticTile.instantiate()
  21.             print(NewTile)
  22.             NewTile.position = vector
  23.  
  24.             NewChunk.add_child(NewTile)
  25.  
  26.         ChunkCont.call_deferred("add_child", NewChunk)
  27.         # _debug_add(ChunkCont, NewChunk)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement