Tilemap manipulation through script (C#)

Hey guys! I am sorry if this was asked before, but I am currently working on a procedural generation algorithm for my game. Although the algorithm prototype is done, I have stumbled on a problem - I do not know how to manipulate the TileMap to work with the algorithm. Does anyone here know a good way to modify the tiles on a tilemap through code? Let’s say to replace a tile with a different one. I guess I do not understand how the Tilemap itself sorts and stores the tile data. Should I create a Tile in script? Is the tile palette used? Sorry for all the questions! I thank you in advance!

Nevermind guys! I found a solution that worked! I am currently just referencing tiles from the palette in my code and modifying the tilemap through it(my main issue was not creating a palette, so having no tiles to reference, just the sprites!)

1 Like