Forum rules - please read before posting.

How to use Change Volume action?

How do I use the Change Volume action? I have a GameObject with an AudioSource and Sound components. I trigger the Change Volume action, which modifies the relative volume property on the Sound component, but it does not modify the volume of the AudioSource. I'm trying to create a radio that the player can turn on and off, effectively setting the volume to either 1 or 0 respectively.

Comments

  • Are you making use of Audio Mixer Groups in your game, and are you trying to change the volume over time?  If so, does it work if you change it instantly instead?
  • I am using Audio Mixer Groups, which are connected in the AC manager. I am trying to change the volume instantly.
  • edited June 2016
    And if you temporarily switch back to rely on regular Audio Sources, does it then work?  Are you manipulating the Sound in any other way, e.g. fading it in?
  • If I manipulate the AudioSource directly, it does change the volume. And I do not modify the Sound component by any other means.
  • So it's set to Play on awake, then?

    My question about the AudioSource was about switching the Volume controlled by field in the Settings Manager temporarily back to Audio Sources.  As I'm unable to recreate this issue, I need to know where the problem lies.  Please post screenshots of your Settings Manager and Sound Inspector as well.
  • edited December 2016
    Hi - having the same issue.

    Audio settings:
    image

    Sound object inspector (before start)

    image

    Sound object inspector (during play)

    image

    Sound object inspector (after triggering Sound:Change Volume)

    image

  • edited December 2016
    Thanks for the info.  At what point do you run the Action, and what version of Unity are you using?
  • 5.4.2.F personal. 

    I used the action with a trigger. Tried moving it at the end of the opening cutscene, but same results. 
  • Can't recreate this with the latest AC - are you using v1.55b?  As with the previous user with this problem, what happens if you switch your Volume controlled by setting back to Audio Sources?
  • Just updated to 1.55b, no luck yet.

    Interestingly, the Audio source volume drops to 0 at runtime, no matter what value I put into the Sound script relative value.

    The audio source volume stays correct when I remove the Sound script.

    I changed the settings to "controlled by Audio sources", and the problem persists. 
  • The sound's final volume is calculated as the global volume setting (as set in the Options menu) multipled by the relative volume.  If it's dropping to zero, check your game's SFX volume.  You can clear exisitng volume options at the bottom of the Settings Manager by clicking Reset options data.
  • Yup that's what it was. Solved! 
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.