Edited the title to reflect the solution so it’ll better help others that might have done the same as me.
Godot Version
4.4.1.stable
Question
I'm trying to figure out why this happens:
Arrow is at Z = 0, walls are at Z = 1. Why is the arrow’s transparency at (about) 50%? It should be invisible since it’s underneath it. Everything, either on the arrow scene or the TileMapLayer, is default, except for the obvious.
Anyone has an idea?
I’m trying to come up with an hypothesis on why this happens and I’m coming up short. 
What does your node hierarchy look like?
It’s simple:
Tried to reparent to the body on which it hits and setting Z to -1 but it gives the same result.
FWIW:
Floors Z = 0
Walls Z = 1
Doors Z = 1
Objects Z = 1
There’s a lot of procedural in there, I think I might be putting some transparency somewhere…!? It’s the only thing I can think of.
Hmm… Just tried:
z_index = body.z_index - 1
and it’s even worse, it’s above visually.
Is there any alpha in the textures of your tilesets?
Oh, that’s a possible thing: Are you using modulate
on any of the layers? If you’re adding transparency to the base layer with modulate
its children will inherit it. self_modulate
doesn’t inherit, modulate
does.
Yeah, I checked those. I wish it had been that simple.
All the four layers are full opacity.
I’ll check the Tileset…
Woo! 
Found the problem! But it’s… WEIRD. Unsure why this would do that…
Alright. In the game I have a CanvasModulate to tint the color of the light I want, for the ambiance and everything. I put a light transparency to the color, like opacity at 75%. Resetting this to 100% fixed the problem. The arrows are now visually properly under the wall.
Then my question becomes, why do tinting objects affects other objects’s transparency? Shouldn’t it just color them with a slightly hazy color without affecting said objects’s transparency values? Or am I misunderstanding how tinting works?
Docs says:
CanvasModulate applies a color tint to all nodes on a canvas. Only one can be used to tint a canvas, but CanvasLayers can be used to render things independently.
After having run the game with that transparency reset, it looks a lot better. Every sprite is clean and clear.
TL;DR: Avoid putting transparency in CavasModulate Color value. Everything will look better that way.
1 Like