Forum rules - please read before posting.

SFX Slider to Affect one SFX and not all sound.

Hi everyone! I hope you're all having a wonderful day.

I have a question about sliders and how to implement them effectively. Here’s some context for what I’m trying to achieve:

I created an interactive TV, and I’d like to make its volume functional. Specifically, I want all sounds attached to it via the Sound script to be toggled on and off with a slider. I was able to set this up, but I ran into an issue: the slider currently disables all SFX sounds globally.

I noticed there’s an option for "Float Variable" in the Slider Affects menu under Element Type. Could that option help in this situation, or do you have any other suggestions on how to solve this?

Thanks in advance, as always! Wishing you all a wonderful rest of the week.

I attached a video here: https://drive.google.com/file/d/1_u6QHSMCDql8aCUfB21TqbJkLmvn0exK/view?usp=sharing

Comments

  • You can use a Float variable, and then link that variable to the Sound component's "relative volume" property, which can be done through script:

    public void UpdateVolume ()
    {
        float floatValue = AC.GlobalVariables.GetVariable ("MyFloat").FloatValue;
        GetComponent<AC.Sound> ().ChangeRelativeVolume (floatValue);
    }
    

    Where "MyFloat" is the name of the variable, and the function is inside a script attached to the Sound object. The Object: Send message Action can then be used to trigger the component's "UpdateVolume" function.

  • thank you @ChrisIceBox, I'll give it a try ! Have a wonderful day!

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.