#Tilemap usage from code

4 messages · Page 1 of 1 (latest)

bright grail
#

Hey all, how do I assign a specific Tile from the atlas i'm using to a tile in the Tilemap?

#

I just need the line of code for this operation.

white turtle
#

The docs are a great resource for things like this: https://docs.godotengine.org/en/stable/classes/class_tilemap.html#class-tilemap-method-set-cell
Try tilemap.set_cell(the layer you want to set the cell on (probably 0 if you only have one layer), the coordinates (as Vector2i), the source ID of the TileSetSource (these are the things that store the images) (also probably 0 if you only have a single source), the coordinates of the tile from the tile set source)

bright grail
#

I fixed this now.