#how do i delete tile in code

5 messages · Page 1 of 1 (latest)

short patrol
#

i have got this:
if event.button_index == MOUSE_BUTTON_RIGHT and event.pressed: var mouse_position: Vector2 = get_global_mouse_position() print("Mouse Clicked at:", mouse_position) var tile_mouse_pos = tile_map.local_to_map(mouse_position) print(tile_mouse_pos) var source_id = 0 var atlas_coord = Vector2i(7,1) tile_map.set_cell(0, tile_mouse_pos, source_id, atlas_coord)

but instead of tile_map.set_cell(0, tile_mouse_pos, source_id, atlas_coord)

which adds a tile i want to delete a tile. so how would i do that?

compact grove
#

atlas_coords should be -1, -1 for an invalid (null) tile

short patrol
#

yep that fixed it

#

thanks

compact grove