Forum rules - please read before posting.

How to change music volume?

I tried various methods but none did work.

When players interacts with an object, I put an action that plays music (I do it this way, because I want the music to continue playing when player change scenes. The thing is that I want the music to have low volume when player enters another scene.
I can't choose another type of sound action or music doesn't carry to another scene. I tried changing volume using "Play" action and putting music into a sound object, but since next scene doesn't have that object it doesnt work and music stop playing when scene changes.

If I make the sound object a prefab, it simply doesn't play it when player interacts with the object that plays the music. Any idea to turn that track volume low when scene changes?

Comments

  • If you're not needing to provide a "Music volume" option for the player, you could use the Save: Set Option Action to control how loud it is.

    Otherwise, you should be able to do it with Audio Mixer Snapshots.

    If you rely on Audio Mixer Groups, then audio volumes are routed through these groups. You can rearrange your Music group so that it's a "child" of an intermediary group whose volume you separately control with a snapshot. This can be done using the Sound: Set Mixer snapshot Action.

  • Okay, I tried that method but somehow it doesnt work.

    I have two AudioMixer snapshots, one is the "master" that has default volume levels and the other is called "Trigger" that has low volume levels.

    I press play. Interact with the item that plays music with an action called Play Music. Before this action is another action that is a Sound: Set Mixer snapshot and "master" is chosen. When I change scene, like I said in the first post, interacting with another item, there's another action Sound: Set Mixer snapshot and now "trigger" snapshot is chosen. Nothing happens. Am I missing something?

    Some screenshots:

    My audio mixers:
    https://i.imgur.com/6vlv2ry.png

    The actions on the interaction that plays the music:
    https://i.imgur.com/sfJnUNr.png

    The actions on the interaction that changes scene (when its supposed to turn the volume down and change scene):
    https://i.imgur.com/3kyoZuc.png

  • My suggestion above was to have a snapshot only affect an intermediary group - one that's between Master and Music in the Hierarchy.

    At runtime, AC will take sync all three group volumes to its Options data, so using an intermediary group is the way to control its volume independently of this.

  • Thanks, Chris, fixed it!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.