Hello, I’m trying to procedurally generate my 2d level via TileMapLayer but facing some challenges. I’ve already tried searching for solutions, but seems like there’s not too much information on it. (There are old posts that does not apply).
My current script doesn’t render anything onto the screen.
I get a runtime error in the editor debugger because !room_for_tile is true in the TileAtlas implementation on line 20: tileAtlas.create_tile(Vector2i.ZERO, tileSet.tile_size)
“The tile is outside the texture or tiles are already present in the space the tile would cover.”
This error does not appear if I switch the texture_region_size assignment to be values less than Vector2i(31, 44) but fails for greater values. Obviously your texture isn’t smaller than 32, 45. I modified the tile_size in the TileSet to check if that was somehow related. I saw no change in behavior after doubling the tile_size.
I do also check the tile atlas’s tiles by calling get_tiles_count() to verify that the first case in the error is not the fault; it always returns 0 when I see that debug error. So the engine is complaining because it thinks it is being asked to create tiles outside of the image bounds. That doesn’t make sense to me given the provided image file which I am also working with in my test project.
Sorry I can’t help more right now, just trying to help by documenting what I can observe.