aimless-skipper

  • Joined Apr 11, 2020
  • 0 best answers
  • I had a similar problem to you, the simplest answer is to use update_bitmask_region(), calling it after the tiles have been generated, with the first parameter being a Vector2 for the first corner, the second is a Vector2 with the coordinates the opposite corner.

    • This is the code:

      extends TileMap
      
      var generation = OpenSimplexNoise.new()
      
      func generate(x_pos,y_pos,w,h):
      	for x in range(w):
      		for y in range(h):
      			set_cell(x_pos+x,y_pos+y+(generation.get_noise_1d(x))*20,0)
      
      func _ready():
      	randomize()
      	generation.seed = randi()
      	generate(-30,50,600,60)
    • I have an autotile set up that works perfectly fine if I make a map using the tilemap in the editor, however I am making a game with procedural generation and when I set the tiles with code it always displays the first tile in the autotile, regardless of the bitmask. how can i fix the autotile so it shows up properly when tiles are set with code?