Hey, is there any smooth way to toggle sounds on and off?
Or will this have to be checked before every msg.post(“sound”, “play_sound”)?
Yes, you can assign your sounds to a group (with the “Group” property on the sound component) and then control the gain of the whole group:
// Turn off all sound fx (that are part of the "sound_fx" group
sound.set_group_gain("sound_fx", 0.0)
I tried setting the group_gain on the sound group I´ve defined but got an error message. It turns out that if you have your sounds in a collection proxy the sound group isn´t created until that proxy is loaded.
Is this working as intended?
I suppose that is intended behavior, to avoid dependencies on content that is not yet loaded (and may never be), but @christian might wanna chime in with thoughts on this design.