- Copy contents into
res://addons/sfx/ - Enable in Project Settings > Plugins
- Create SFX.tscn with Node root, attach
sfx.gdscript - Add SFXBridge.cs as child node (for C# support)
- Add autoload:
SFX.tscnas "SFX"
Create an SFX scene with the following heirarchy,
SFX (Node, sfx.gd)
├── DoorOpen (Node, sound_group_3d.gd)
│ ├── door_open_01 (AudioStreamPlayer3D)
│ ├── door_open_02 (AudioStreamPlayer3D)
│ └── door_open_03 (AudioStreamPlayer3D)
└── DoorClosed (Node, sound_group_3d.gd)
└── door_closed_01 (AudioStreamPlayer3D)
└── and so on...
Tag your main camera with group "MainCamera" or call SFX.set_main_camera(camera).
GDScript:
SFX.play("DoorOpen") # at camera position
SFX.play_sound("Footstep", position) # at specific locationC#:
Add SFXBridge.cs as an Autoload, then use,
var sfx = GetNode<SFXBridge>("/root/SFX/SFXBridge");
sfx.PlaySound("DoorOpen", Position);Each SoundGroup3D group applies their respective settings to the pool they manage,
max_voices: Concurrent soundsvary_pitch: Random pitch rangevary_volume: Random volume range
Open any scene with root named "SFX" and use the bottom SFX panel to test sounds without running the game.
For non-3D sounds (UI, music), use SFX2D - a simpler version without spatial positioning.
Create SFX2D.tscn with the following hierarchy:
SFX2D (Node, sfx2d.gd)
├── Accept (AudioStreamRandomizer)
└── Cancel (AudioStreamRandomizer)
└── and so on...
Add autoload: SFX2D.tscn as "SFX2D"
GDScript:
SFX2D.play_sound("Accept")
SFX2D.play_sound("Cancel")C#:
var sfx = GetNode<SFXBridge>("/root/SFX/SFXBridge");
sfx.Play2D("Accept");
sfx.Play2D("Cancel");sfx.gd- Main 3D audio systemsfx2d.gd- Simple 2D audio for non-3D soundssound_group_3d.gd- Manages sound variationssfx_plugin.gd- Editor integrationsfx_preview_dock.gd- Preview interface
MIT by Paul Hill
