class_name GroundButton extends Area2D @onready var sprite = $Sprite2D @export var nodes: Array[Node2D] var is_active = false func _on_body_entered(body): if body is Player: is_active = not is_active sprite.frame = 1 if is_active else 0 for node in nodes: if node is TileMapLayer: var layer = node as TileMapLayer layer.enabled = !layer.enabled else: node.visible = false if is_active else true node.process_mode = PROCESS_MODE_DISABLED if is_active else PROCESS_MODE_INHERIT node.set_physics_process(!is_active)