Why is my partially transparent tilemaps showing up with gray backgrounds

Godot Version

4.3

Question

Hello! I am a total beginner at using a game engine. I’ve figured out how to use and paint tilemaps so far, but I’ve come across a problem. I have several tilemaps with a bit of transparency before the tile ends. I noticed after painting and testing the tilemap out that it seems to have a gray background where I want transparency inside the actual tile. I’ve probably missed something. Does someone know why this happened and how to fix it?

What format is the source image?

Each tile is 16 X 16 and exported from Krita as a png and I used tilemap (not layers). I searched some more and it seems like the old tilemap system is getting replaced by tilemaplayers. Do you think that has something to do with it?

I guess you need to tweek the image setting Material - Transparency → Transparency mode… (In 3D it is)…

You probably want to use TileMapLayer, but I’m not sure that’s the cause of the problem here. PNG supports transparency, but not all pixel formats PNG supports handle it; if you’ve got a PNG with indexed colors, or no alpha channel, there may be no transparency in the PNG.

I’d suggest pulling it into a layer in GIMP or photoshop and seeing if it’s actually transparent.

Look like the default background color of the game. Did it change when you change environment color from the game settings?
If it is and you want your black grid tile as background, you need to draw grass tile in another layer, otherwise it remove the previous tile.

You need to place the tiles on a different layers so they dont override your other placed tiles

1 Like

I don’t understand exactly what you mean with having the tiles on different layers. I tried switching over to tilemaplayer to see if the problem was still there (it was). As you can see on the picture, I have (I think) several layers of tilemaplayers. Is there another way to separate the tiles than I’ve done in the screenshot (Dark sky is supposed to be furthest away from the camera)?
If I release the connection between Dark sky and Dark grass nothing happened with that gray background on the more transparent tiles.


Theres the layer you selected. did you put them on seperate layers? Also i assume this is pixelart you are working with: You should set the 2D-Texture-filter to nearest in the project settings

In that picture I used the old tilemap. I switched over to tilemaplayer and I haven’t found that option there. Is it perhaps somewhere else in the tilemaplayer function?

TileMaplayers are the different layers themself, so you should put the darksky on one layer and the dark grass on the other.

Try to make the tilemaplayers siblings then this option should also appear

I changed the background to pink and the grass tile background is now also pink so I think you’re right that it somehow overrides my sky tile. The new tilemaplayer function is overall a bit tricky to get a hang on. I don’t seem to be able to paint in tileneighbours like I did on the old tilemap function either.

This is how it looks like right now with tilemaplayers:

Are they not already on different layers? They are connected to Node 2D not each other now.

So you put the tiles on different layers, right? And you are sure the grass-tiles are transparent?

I suggest to set the 2D-Texture-Filter to nearest and see if something changes

Do you know where I can find the 2D-Texture-Filter?

Project-Settings → Rendering → Textures → default texture filter. Set it to nearest

I changed it to nearest in the default texture filter (didn’t find 2D-Texture-Filter) but the problem is still there.

In this case either your texture is not transparent or you didnt put the tiles on different layers

1 Like

I thought the tilemaplayers were the actual layers. How do I check if the tiles are on the same layer?

They are layers but you can switch between them