- Home /
Question by
NettleBana · Oct 29, 2020 at 06:14 AM ·
scripting problemuiaudio
Slider that changes music track,Slider that controls what song is being played
I wanted to make a slider that changes the song when I move the slider. The problem I am facing right now is that the music is always constantly on and it does not react to the slider's value. I was wondering if there is an actual way to make this work. This is the script I have right now, I hope you can help me solve this issue :(
public void Changed()
{
if (musicSlider.value > 1)
{
indie.SetActive(true);
}
if (musicSlider.value < 2)
{
rock.SetActive(true);
}
}
}
Comment
Answer by HitarthPadaliya · Oct 29, 2020 at 11:12 AM
Are you calling this function from anywhere? It may happen that you are not calling this function.
Try debugging. Add a Debug.Log (yourMessage) line in Changed () function (don't insert this line inside the if statements).