I was wondering if I can draw a pattern in GODOT 4 at runtime,
through code, I am currently tring to use get_pattern and set_pattern and calling this function at _ready as you can see below.
However on runtime it doesnt show. Please let me know what Im doing wrong. Any help is apreciated!
TileMap.get_pattern() creates a new TileMapPattern from an array of cells from the TileMap
If what you want is to set patterns you already have in the TileSet then you’ll need to use TileSet.get_pattern() and then use that TileMapPattern in the TileMap.set_pattern() function.
For example:
var pattern = tile_map.tile_set.get_pattern(0)
tile_map.set_pattern(0, Vector2i(10, 10), pattern)