22 lines
410 B
GDScript
22 lines
410 B
GDScript
extends Node
|
|
|
|
@export var player_audio_pool = []
|
|
|
|
var random_audio : AudioStreamPlayer
|
|
|
|
func _ready():
|
|
pass
|
|
|
|
func _process(delta):
|
|
random_audio_setter()
|
|
|
|
if !self.get_parent().velocity.is_zero_approx() && !random_audio.is_playing():
|
|
random_audio.play()
|
|
pass
|
|
pass
|
|
|
|
|
|
func random_audio_setter():
|
|
random_audio = get_node(player_audio_pool[randi_range(0, 2)])
|
|
random_audio.set_max_polyphony(10000)
|
|
pass
|