scale animation result?

Hi,

I have a little animation that fades in different music tracks from volume 0 to 1. works fine, but I want to allow the user to set the MusicVolume. I’d multiply the musiVolume with the desired volume but how can I do this when using the animation system? So that in the end, the volume isn’t 1 but 0.5, depending on the MusicVolume?

Store your music volume setting as a float from 0f to 1f and multiply the animated value by that property value. Make sure that you set your new volume constant in some other place besides Update; otherwise your volume will diminish over time.

Options for this would include:

  1. Having a master controller object that retains your volume settings; when the GUI is updated by the user, pipe your new values into this controller. In your update loops in the various components where volume is consumed you’d then use the constant value.
  2. Implement events and use a delegate to apply the change to your volume.