How to bind slider "steps" with different scaling values of a StaticMesh ?

Hey all, I’m currently working on a widget slider which is setting a cube scale on the X axis. In the Event Graph of my widget blueprint I’m calling an Event Dispatcher to do so and everything is working fine.
However, when I’m dragging my slider from 0 to 1, the cube will gradually change from its initial scale to its new scale value, and I would like for this change to be radical without going through intermediate values.
So how could I lock my slider to either select my initial scale value or select my new scale value ?
Here are some screenshots of my blueprints :

My final project is to set different values for my cube X axis scale and to bind it with my slider steps. I’ve managed to do create steps for my slider, with a Float Variable linked with the value of the slider.
So, my other question is how to bind different scaling values of my cube with the slider “steps” ?
I’ve just started learning about blueprint so if anyone can point me in the right direction that would be great, thanks !

Hey @Patfoodya1! Welcome to the forums!

Sliders work best with a consistent scale, so numbers like “0, 50, 100, 150”. If that’s doable for you, great! Set that multiplier on your event to the scale # you want, and use the ROUNDED number on your widget instead of the pure float! :slight_smile:

If you’re going for something like “1, 7, 11, 500, 17352” you’re probably going to need to use another kind of interface, like a set of buttons. :slight_smile:

Hey Mind-Brain thanks for your welcome and the fast answer ! :smile:

What do you mean by using a Rounded number on my widget ? Should I replace my float variable by something esle ? (image below)

Since my values won’t be consistent, I’ll probably use a set of buttons then, thanks for pointing this out :slight_smile:

I meant to round the value you’re sending through the event (New Param) to make it adjust in chunks because it’d be interval instead of float.

And you CAN use a slider for this. It’s just more complicated because it would likely have to pass through a selector and you’d set the selector to have the values you’d want.

Lets say we set up a slider like so:

image

It can only output values 2, 3, 4, 5 and 6. We can re-map them onto another range. Perhaps vectors since we’re going to scale things:

Now, the slider will actually spit out specific scale values you can use elsewhere.

A MAP! Yes!

@Patfoodya1 Do what Everynone has here, I always forget about map variables! This should get you exactly what you need! And if it’s permanently only the X value (or a single value being adjusted with no change to others), you can make the second variable of the map a float instead of a vector if needed.

It’s like I was thinking with a selector but smoother and in a nicer package as a variable.

Sorry for the late reply, but it’s working ! I would have never thought of using a Map Variable in this case, thanks so much @Mind-Brain and @Everynone for your help :slightly_smiling_face:

It leads to another question on my side, since my values are now listed inside the MAP Variable, how could i do to tell Unreal to use these values instead of the multiplier in the Custom Event ?
For now, it’s working if my cube has at the start a O scale value assigned in the X axis and a 1 multiplier added to my Initial Cube X Scale Variable. But, I was wondering, if my cube doesn’t have a O scale value in the X axis, is there a node or something else to use first my Initial Cube X Scale variable and then my New Scale Parameter variable ?

I’ve resolved my question by putting the values I wanted minus the Initial cube x scale value in the map variable!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.