Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Range slider

Discussion in 'Scripting' started by a2kas, Feb 24, 2019.

  1. a2kas

    a2kas

    Joined:
    Jan 14, 2019
    Posts:
    11
    Hello,i need UI slider with two handlers (like in the picture), how could I make it? maybe do you know any example?

    slider.png
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    7,627
    The Unity3D UI Slider code is actually all open source, so you could take the existing Slider.cs file and make your own, like maybe SliderRange.cs.

    The code is all in here:

    https://bitbucket.org/Unity-Technologies/ui

    The Slider.cs is under UnityEngine.UI/UI/Core I believe.

    If you come up with something spiffy, post it back here, or even better, clean it up and submit it to Unity for inclusion!
     
  3. ProtagonistKun

    ProtagonistKun

    Joined:
    Nov 26, 2015
    Posts:
    293
  4. a2kas

    a2kas

    Joined:
    Jan 14, 2019
    Posts:
    11
  5. ProtagonistKun

    ProtagonistKun

    Joined:
    Nov 26, 2015
    Posts:
    293
    Oh right, I missread that. You can however look at the source code for that for an idea on how to do it since it uses the same system maybe (probably)
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    7,627
  7. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    785
    Hello,

    I need a slider with two handles that works in the UI canvas in the game (not in the inspector) anybody know where i can get that?

    Thanks
     
  8. Dover8

    Dover8

    Joined:
    Aug 20, 2010
    Posts:
    92
    I also had this requirement recently. I got a workable solution. Give me a few more days and I'll be making a pull request to the UI Extensions library with it. https://github.com/Dover8/Unity-UI-Extensions/tree/range-slider
     
unityunity