Forum rules - please read before posting.

Trying to set SFX volume via code

OniOni
edited March 2018 in Technical Q&A
Hey,

We would like to customize our sound settings and because of that we use the provided sound functions of AC in a custom script:

//Works well
KickStarter.options.SetVolume(SoundType.Music, vSlider.value);

//Is not doing what we expected
KickStarter.options.SetVolume(SoundType.SFX, vSlider.value);

//Works Well
KickStarter.options.SetVolume(SoundType.Speech, vSlider.value);

So we have a problem with setting the SFX volume. While pausing game the player can change the volume by using a slider. At this point SetVolume() for SFX sets the value, but when we resume to the game the SFX volume lerps to a value which we never set. Is AC doing something in the Background with the SFX Volume? 

For example:

The Player sets the SFX Volume to 0.3, but when player hits resume the value lerps to 0.1f.


Comments

  • What's your AC version?  Some fixes were made regarding the direct-setting of sound volumes.

    Also, you can use specific methods to set sound type:
    AC.Options.SetMusicVolume (vSlider.value);
  • Hey Chris thanks for your response! So currently we're using version 1.60, and I tried to use SetSFXVolume() but nothing changed the same problem appears again. We will Update to a newer version maybe this problem disappears then :)
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.