How do you set the slider thumb to a value/step with a trigger?

Jan 10, 2023

I'm trying to get my slider thumb to jump to a value when the user releases the slider before it reaches the set value. I've tried several variables and triggers to try to make that happen, but it's not working. It seems to be setting the value without moving the thumb. So, my layer shows because it changes to the correct value, but the thumb stays put where it's dropped. It should also jump to that value.  What triggers are needed to make this happen?

I've started with increasing the end value to create more increments. That didn't work, so I also tried changing the step to a decimal. I've tried a trigger that sets the slider to a value when it moves and is between two numbers and I've also tried a trigger to set the value when the variable changes. Neither has worked. I tried playing around with the update setting from "when it's released" to "when it's dragged." I'm stuck. Hopefully, someone can help, please!

10 Replies
Walt Hamilton

It sounds as if you are showing a layer with a different slider on it. That slider has a different variable than the base layer, so when the base layer changes, it jumps to the new layer. The base layer thumb moves, but it doesn't look like it because the layer slider's variable doesn't.

Your first step is to get rid of the triggers (except for the one that shows the layer), because when a thumb is dragged, it updates the variable, and moves the thumb. You have a choice for the second step. Either change the design so the layer allows the slider from the base to show through, which is far preferable and easier. You may have to remove a background from the layer to do this. The other option is to set each slider to use the same variable as the original on the base layer so they are all updated at the same time.

That's my best guess. If it isn't what is happening, attach your .story file here and someone can take a look at it.

Natalie Wenzelow

Hi Walt,

Thank you for your help with this! The second paragraph you wrote is true that the slider is showing through on each layer. There's only one slider.

We originally had the steps at 1 which works fine, but what we are trying to do here is make the sliding smooth and make it jump to the next increment if the mouse is released before getting there. This will be more user-friendly when we have less layers and a bigger space between increments.

I only added a new trigger for the first layer so far. And I've also tried increasing the total number of increments instead of changing the step to a lower value and it still didn't work.

Thank you!

Walt Hamilton

It seems to me that you want the layers to show when the slider moves, and the thumb to jump when the learner releases the thumb. That's a difficult ask, because updating the variable when the slider moves, and updating it when the slider is released are mutually exclusive actions.

Nevertheless, take a look at the attached sample.

 The slider jumps slide has a couple of methods that might work. Moving to layer 1 shows one option. If you stop moving the thumb, and don't move it again before you release the mouse, the thumb jumps to the corresponding triangle.  Moving to layers 2 - 4  (and from 2 back to 1) shows a different method that I think works (marginally) better. Personally, I don't like either one, because when the thumb jumps, the learner loses control of it.

I much prefer redesigning the slider, using visual clues to show its location. See the Zones slide.

At any rate, if you find anything useful, you are welcome to it.

 

Natalie Wenzelow

Thank you, Walt! The second is what I was looking for! It's a little glitchy, but maybe I can work on improving it. Thank you so much! Is there a way we can indicate that the file above is not a shareable template or remove it, please? I would love for others to be able to see it so they know how it works, but not use it exactly as is.

Moritz Weber

Hi Natalie,

I had the same issue right now.

The "automatic" jump of the slider used to work really nice in earlier versions of SL. Roughly like this:

If slider_var ist between 50 and 150 set it to 100. This is not working any longer. Dont know why. All my older projects I have to adjust now :/

What you have to do now is for example is:

When slider_var is between 50 and 150 when released open layer 1

On layer 1:

When timtline reaches 0,01 sec. set slider_var to 100!

"When wimeline strats" is not working... Dont know why...

I hope that helps you!

Best, Moritz