diff options
Diffstat (limited to 'client/audio/play_random.gd')
-rw-r--r-- | client/audio/play_random.gd | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/client/audio/play_random.gd b/client/audio/play_random.gd index 1efced30..afdf046f 100644 --- a/client/audio/play_random.gd +++ b/client/audio/play_random.gd @@ -16,13 +16,20 @@ extends Node class_name PlayRandom -@onready var sounds = get_children() +@export var volume_db := 0.0 +@export var enable_attenuations := true var autoplay := false +@onready var sounds = get_children() + func _ready(): - for s in sounds: + for s: AudioStreamPlayer3D in sounds: s.connect("finished", sound_finished) + s.volume_db = volume_db + + if not enable_attenuations: + s.attenuation_filter_cutoff_hz = 20500 func play_random(): var s = sounds[randi_range(0, sounds.size() - 1)] |