Files
SpaceBots/script/ButtonLogicImpulse.gd

15 lines
303 B
GDScript3
Raw Permalink Normal View History

2026-01-21 23:40:20 +01:00
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()