super_space_game/scripts/interact_area.gd
2025-12-06 12:19:32 -05:00

12 lines
360 B
GDScript

extends Area2D
@export var interact_text = "INTERACT"
var game = null
func _on_body_entered(body: Node2D) -> void:
if body.get_name() == "PlayerGround":
game.current_interaction_area = self
func _on_body_exited(body: Node2D) -> void:
if body.get_name() == "PlayerGround":
if game.current_interaction_area == self: game.current_interaction_area = null