Godot Version
4.2.1
Question
in this game, we are trying to make some walls transparent when the player goes behind them, but the problem is: when the game starts, all of those walls and obsticals are already transparent and the player has to go behind them and come out to make them normal again.



and here is the code for making the layers transparent and untransparent:
extends TileMap
@export var invisible_color: Color = Color(1.0, 1.0, 1.0, 0.22)
@export var visible_color: Color = Color(1.0, 1.0, 1.0, 1.0)
func _untrans1(c, d):
set_layer_modulate(c, d)
func _trans1(a, b):
set_layer_modulate(a, b)
func _on_area_2d_body_exited(body):
_untrans1(1, visible_color)
func _on_area_2d_body_entered(body):
_trans1(1, invisible_color)
func _on_area_2d_2_body_exited(body):
_untrans1(8, visible_color)
func _on_area_2d_2_body_entered(body):
_trans1(8, invisible_color)
func _on_archive_body_exited(body):
_untrans1(13, visible_color)
func _on_archive_body_entered(body):
_trans1(13, invisible_color)