This repository has been archived on 2024-07-02. You can view files and clone it, but cannot push or open issues or pull requests.
HoppyEaster/Scripts/SFX/PlayerAudioManager.gd
2023-04-12 12:56:44 +05:30

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