Post by DarkTonic Dev on May 27, 2023 21:15:15 GMT
If you get no sound, it's probably just too quiet to hear because it's too far away from the Listener. Try flipping the Master Audio Mixer to Spatial Blend Rule to "Force to 2d" to check before proceeding.
You can always rename the Sound Group in the Hierarchy Window to whatever you like.
I've tried several things that don't work. Is there any documentation that shows the exact steps required to set up a sound group with variations that you can call by a custom string name?
The only way I can get a group variation to play is by using the first name it shows in the MA inspector when the first sound clip is added.
My steps that work:
- Drag 1 clip as new sound group
- Select new group gameobject in heirarchy
- Drag in more sound clip variations
- Call in code. eg: MasterAudio.PlaySound3DAtTransform("Name of first clip in MA inspector", this.transform);
From there, how do I use a custom string name to call the group?
ClipID doesn't work.
Changing the gameobject in the inspector doesn't work.
Perhaps along with that question, is there any debug/logging to indicate that the clip named in the call to PlaySound3DAtTransform() doesn't exist or wasn't found?
If you want to play a particular variation by name or alias, that's a different optional parameter, that you didn't use in your code sample. The name of the Sound Group is still required, which you can change in the Hierarchy window if you like. Sound Group names must be unique, but it's perfectly fine to have a Variation name duplicated in different Sound Groups.
So the following code would play a Variation named (or aliased with) "LouderSurprise" in Sound Group "Treasure".