Search Unity

Change UI Slider's Incremental Value

Discussion in 'UGUI & TextMesh Pro' started by jsleek, Feb 23, 2015.

  1. jsleek

    jsleek

    Joined:
    Oct 3, 2014
    Posts:
    61
    Hi there,

    I know it is possible to change the increment value of the UI Slider to whole numbers (1, 2, 3 etc.), but I'm wondering if its possible to change it to a custom value, increments of 0.1 perhaps (0, 0.1, 0.2, 0.3 etc.)

    Does anyone know how to do this?

    Cheers!
     
  2. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    Sadly no, that is not a capability of the current slider control. If you needed it on a Slider then you would need to extend it yourself as a new control.
    However the ScrollBar control can, as you can set the max number to 1 with 10 steps, which would result in 0.1 increments
     
    Tymianek and BubbleheadStudios like this.
  3. kideternal

    kideternal

    Joined:
    Nov 20, 2014
    Posts:
    82
    You can just check the "Whole numbers" checkbox and then in your handler/method multiply the value by something to give you the values you want. Update the text label using the new value.
     
    BubbleheadStudios likes this.