#Tilemap terrain update-issue

4 messages · Page 1 of 1 (latest)

limpid tiger
#

why doesnt the terrain update?

func place_cell(cell : Vector2i, x, y):
    var cell_position = tile_map.local_to_map(highlighter.global_position)
    tile_map.set_cell(0, Vector2i(cell_position.x, cell_position.y), 0, cell, 0)
    var cells = []
    var location = Vector2i(x, y)
    cells.append(location)
    tile_map.set_cells_terrain_connect(0, cells, 0, 0)

im new to godot, and couldnt find a good explonation

austere tree
#

You don't need both set_cell and set_cells_terrain_connect. Only the second, and only if you want terrain sets to use the correct tiles based on your tileset terrains.

#

The way you're calling set_cell also means that you need a tileset with source_id == 0 and it needs to be a TileSetAtlasSource with a valid tile at the specified coordinates.

#

To help debug further, you need to show your tileset including source ID and any terrains you have. As well as the values you're passing to place_cell.