extends Node2D

onready var activatorArea = $"%ActivatorArea"
onready var indicatorPlayer = $"%IndicatorPlayer"
onready var signal_manager := get_tree().root.get_child(4).get_node("%SignalManager")
onready var unactivatable_timer := $Timer

var activatable = true
		

func selfActivate():
	indicatorPlayer.play("onning")
	#TODO dis importante
	activatorArea.set_deferred("monitoring", false)
	#TODO Close gate again?
	signal_manager.emit_signal("unlocked", "gateblock")


func _on_ActivatorArea_body_entered(body: Node) -> void:
		if(!body.is_in_group("player") && !body.is_in_group("frog")):
			return
		$Highlight.visible = true
		if activatable:
			selfActivate()
			activatable = false
