Files
SpaceBots/script/ButtonLogicImpulse.gd
2026-01-21 23:51:53 +01:00

15 lines
303 B
GDScript

extends Timer
class_name ButtonLogicImpulse
@export var interactBox: InteractBox
signal onPressed
func _ready() -> void:
interactBox.interactedWith.connect(onInteraction)
one_shot = true
func onInteraction(_playerReference: PlayerCharacter) -> void:
if is_stopped():
onPressed.emit()
start()