12 lines
274 B
GDScript
12 lines
274 B
GDScript
extends Node
|
|
|
|
|
|
func playSFX3D(stream: AudioStream, position: Vector3) -> void:
|
|
var sfx : AudioStreamPlayer3D = AudioStreamPlayer3D.new()
|
|
sfx.stream = stream
|
|
sfx.bus = "SFX"
|
|
add_child(sfx)
|
|
sfx.global_position = position
|
|
sfx.play()
|
|
await sfx.finished
|
|
sfx.queue_free()
|