2025-12-03 02:56:54 +00:00
|
|
|
extends Area2D
|
|
|
|
|
|
|
|
|
|
@export var interact_text = "INTERACT"
|
|
|
|
|
var game = null
|
|
|
|
|
|
|
|
|
|
func _on_body_entered(body: Node2D) -> void:
|
2025-12-07 06:34:20 +00:00
|
|
|
if !game: return
|
|
|
|
|
|
|
|
|
|
if (body.get_name() == "PlayerGround") or (game.get_node("PlayerGround").is_ancestor_of(body)):
|
2025-12-03 02:56:54 +00:00
|
|
|
game.current_interaction_area = self
|
|
|
|
|
|
|
|
|
|
func _on_body_exited(body: Node2D) -> void:
|
2025-12-07 06:34:20 +00:00
|
|
|
if !game: return
|
|
|
|
|
|
|
|
|
|
if (body.get_name() == "PlayerGround") or (game.get_node("PlayerGround").is_ancestor_of(body)):
|
2025-12-03 02:56:54 +00:00
|
|
|
if game.current_interaction_area == self: game.current_interaction_area = null
|