My problem. Moving the slider it will always translate in steps of 0.3-0.4f only. How do I make it so the slider is moving smoothly in steps of 0.1? If it can’t be done without lerping, than why allow float steps to begin with?
And no, dividing the full integer by 10 doesn’t have any impact on the slider transition.
Is there any setup for the GUI I’m supposed to apply, like minWidth/maxWidth, because I already tried that as well.
The value translates smoothly if I expand the width for all GUILayout elements, which is not what I want. I want it to translate smoothly, independent of the size of any GUI element. Like there is supposed to be a parameter to exactly define the transition steps in any of the GUI/GUILayout slider elements. Even Papyrus(utilizing action script) has this.
So this is probably supposed to be a #featureRequest. Put parameters: steps in any of the GUI slider elements please.
That’s impossible. The slider is moved by your mouse. Your mouse can only move one pixel, not half a pixel. So you’re always bound to the pixel limit with a slider. How would you stop the slider in between two pixels?.
Of course in theory it’s possible to use mouse movement to change the value more slowly, however in this case you don’t have a visual slider that can be moved around freely. I’ve seen software which tried to implement such a slider, but the usage is not great. You would need to implement some sort of “mouse acceleration” in order to allow fast and slow movement. A bit like Unity’s sliding behaviour in the editor when you click on the label of a float field and drag the mouse. This is a dragging behaviour that is not bound to a visual slider but just applies the mouse delta to the value.
In short: a visual slider is bound to it’s visual representation and you can’t have more “stops” than the visual representation allows.
Uhmm, no. That might be true for the UI in Unity, or whatever other UI related script engine is responsible, because you can perfectly do it within Action Script.
The step amounts depend on the size and the numerical range. For visual steps, that might be based on Unity’s drawing and input parameters, not sure whether this can get to the pixel level. Curious, what do you mean by “perfectly do it within ActionScript”? I would assume the same restrictions are in place there. (I’ve used AS quite a bit.)
As I said when you use raw mouse input with a virtual cursor you could implement an infinite precision slider. You just need a way to dynamically change the increment speed. However with a slider that is used by a hardware cursor you can not get a precision higher than the visual / graphical resolution.
I rarely used Flash / AS and this is a thing of the past. However you may got confused by the snap interval setting. The snap setting, as the name suggests, just snaps the value to the nearest interval value. However it does not guarantee that you can reach every possible value. If you create a slider that has a visual range of 100 pixels there are 100 concrete positions the slider / mouse cursor can be positioned. So you can not cram more stops into that range that you have. Imagine an extreme case. Having the values from 0 to 100 with a snap interval of say 0.01 (so 100 subdivisions between two whole numbers) would give you a range of 10000 individual values. However the slider can only stop at 100 positions.
The snap interval is mainly for the opposite case. So you usually have more visual space than concrete values like it’s explained in the AS docs I’ve linked. So setting a snap interval of 0.2 will simply round the current value to the nearest multiple of 0.2.
Unity does not have any in-build snap settings. However you can apply your own snapping. Though snapping does not increase the usable range, it just restricts it.