How do I adjust volume during a crossfade ?

0 favourites
  • 3 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • Hello everyone,

    I'm trying to implement the new "Fade Volume" action to crossfade musics, but I have a problem with it : once the crossfade has started, I cannot adjust the Music Volume effectively.

    I have a "Music Volume" slider as well as a "FX Volume" one, so I cannot simply adjust Master Volume because it would impact FXs too.

    I want to ensure players can change the volume even if a crossfade is in action.

    How would you solve this ? I can't use the "Set Volume" action because it immediately stops the fading.

    Thanks in advance for your suggestions !

    I'm trying to make my Sound Management System leaner than before, and I thought the Fade Volume would be great for that but this problem is making me pull my hair.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I would probably make two separate variables:

    MusicVolume - a number from -100 to 0, changing with the slider.

    VolumeFade - a number from 0 to 1, changing with lerp or some other method.

    During the crossfade, set music volume to (MusicVolume/VolumeFade)

  • Thanks for your answer dop2000 !

    I don't think your solution works key in hand since setting music volume immediately interrupts the built-in fade mechanic. What would be possible would be to maybe restart the fade for the remaining time, but that's a bit complicated and frankly at this point it doesn't seem much easier than my previous audio manager which was lerping two sounds in the opposite direction...

    I think I'll give up on this idea since my previous code worked ok. It's just too bad this new feature is not flexible at all.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)