Forum Discussion

blimey.tv's avatar
blimey.tv
Member
30 days ago
Solved

Muting music only

Hi

Even though we added music to the game, we'd like to add a button that will let players turn off the music if they'd rather listen to their teammates and friends. So far, we couldn't mute just the music channel. We could only stop all the sounds. Any help that you could give us in how to control just the music in the game would be greatly appreciated.
Thank you,

  • There is nothing built in but there is a way this can be accomplished. When playing audio from code you can add AudioOptions with fade, players and audibilityMode. What this means is you can supply an array of players and set the AudibilityMode 0 (can hear) or 1 (cannot hear). You will need to make an audio manager script that has a reference to all music Audio Gizmos and when someone wants to mute music you can run audioGizmo.stop({listOfMutedPlayers}) on all music audio gizmos. You will need to find a way to get the player reference and update an array with player that want to be muted through some mechanism (screen overlay button, CUI button, trigger, etc.).

2 Replies

  • To clarify, this question relates to muting music in Horizon Worlds Desktop Editor

  • There is nothing built in but there is a way this can be accomplished. When playing audio from code you can add AudioOptions with fade, players and audibilityMode. What this means is you can supply an array of players and set the AudibilityMode 0 (can hear) or 1 (cannot hear). You will need to make an audio manager script that has a reference to all music Audio Gizmos and when someone wants to mute music you can run audioGizmo.stop({listOfMutedPlayers}) on all music audio gizmos. You will need to find a way to get the player reference and update an array with player that want to be muted through some mechanism (screen overlay button, CUI button, trigger, etc.).