funnymemellama/Suit.gd
2023-10-02 18:15:10 -04:00

25 lines
472 B
GDScript

extends Area3D
@onready
var _grab_sound: AudioStreamPlayer3D = $GrabSound
@onready
var _voice = $VoiceOverlay
func _ready():
_grab_sound.finished.connect(_on_sound_finished)
_voice.finished.connect(_on_sound_finished)
func _on_body_entered(body):
if body.is_in_group('Players'):
hide()
_grab_sound.play()
_voice.play()
func _on_sound_finished():
# Make sure both sounds are done playing
if not _grab_sound.playing and not _voice.playing:
queue_free()