Hi guys, I’m just learning godot and now i’m making my simple dummy top-down game. Something that bother me is the player’s character could be blocked by trees when it moves ‘behind’ the trees. I try to make it a little bit trasnparent when player’s position is behind the tree, but instead of just making it transparent on tree that in front of player, it makes all the tree modulate to the same value. How do I approach to this problem?
for information, I’m using TileMapLayer for the tree and CharacterBody2D for the player character
If the tree is just one tile you could try using TileMapLayer._use_tile_data_runtime_update()
and TileMapLayer._tile_data_runtime_update()
callbacks to modify the TileData.modulate
alpha value of the tile.
Also, off topic but this post is in the wrong category. It should be in Help - Godot Forum
1 Like
thanks for the answer and I’m sorry for the wrong topic. It won’t happen again.