I want to randomly create a map through code, so I call the Tilemap.set_tile() function in code. My tilemap has an atlas(I think it's called that) with a single 16x16 png texture with the id:0. I haven't touched anything with layers so the layer is 0. In code I am calling:

set_tile(0, Vector2i(x,y), 0)

For some reason no tile is being "spawned". I can manually place tiles with no problem. What is going on here ?

    Bilal Help is very much appreciated.
    It's a bit wierd how the 3 questions asked a bit after I asked mine have more than 15 replies and mine has zero.

    I am doing a tilemap game, but for a 2D game I have no reason to use Godot 4 yet. Does placing the tiles with manual coordinates work as you'd expect? Such as set_tile(0, Vector2i(1,1), 0) for example.

      So in godot 4 a lot of api cleaning and reform happened for the sake of consistency between the 2D and 3D nodes. Sometimes it was some of the 3D nodes that got changes to be closer in consistency to 2D nodes and vice versa. In this case the set_tile call got changed to set_cell so it's more in line with 3D tiles(gridmaps). That is to say if you look at the api docs, tilemap class doesn't have a set_tile() method anymore. There is however set_cell().

      Short term it will be causing confusion and chaos, but in the long term this will be a good thing, since things that already were obvious equivalents between 2D and 3D in godot will now have consistent api call/class and class method names rather than being named something different for whatever arbitrary confusing reason.

      equeste Yea that is also what O meant I just mistyped it's name here, but nvm the problem has been solved