[Slider extension] Incorrect slider position when starting a scene

Change the value of a slider to a specific value, this will move the thumb to the correct position

@tristanrhodes This is for you :kissing_heart:

What are your events? I usually set the slider value at the beginning of the scene and they show the right position.

The slider value is stored in a variable

From the screen shot, it looks like the top slider has 39% as the text, but the knob is at the right hand side, at 100%.

@Marandici, can you provide a screen shot of where and how you set the slider value on start of scene?

@Marandici, your screen shot doesn’t who how you set the value at the start of the scene. You say it’s held in a variable, so I’d expect a screen shot of some events assigning the value of the variable to the slider. You’ve provided the behaviour set up.

I need the position of the slider to be equal to the variable

The value of the slider should be between 0 and 1. The problem is you are setting the value of Sound to Sound_request, which is greater than 1. Look at the value you’re saving to storage in the events further down - you are saving the slider value * 100 into storage, but not dividing by 100 it when you read it back.

Why are you multiplying the value by 100? Why not just save it as is and save the conversion hassle? Just do the conversion once when you set the text value of Sound_prc. Here’s a simplified version of what you’re trying to achieve, giving the same result:

Or, if you want to get really minimalistic, use the following and save the slider value to a variable once save is pressed:

Also, why do you have the scene variables Sound_request and Sound_scene? They appear to do the same thing, holding the same value. It’s a duplication of the value and increases the potential for errors.

[edit]
To change the volume icon :

1 Like

Thank you very much everything works