Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Albatros155 · Dec 05, 2014 at 08:52 AM · guisliderunity4.6

Minmax slider on Unity 4.6?

Hello,

I'm currently testing few things on Unity's new UI system and I was surprised that it seems to have no MinMax Slider. So here are my questions:

1) If there is a simple way to create that, I would love to know about it :)

2) If not: Is there is someone that already tried to do it? I was thinking about create a script that inherit from Slider script and modify all behavior but that seems painfull and public member doesn't seems to appear in Editor :/

Does anyone have a solution? :)

Otherwise, I think it will be fine with InputField, thanks!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by HarshadK · Dec 05, 2014 at 08:52 AM

Under Slider there are two variables called Min Value and Max Value that you can set to make it a MinMax Slider with your specified values.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Albatros155 · Dec 05, 2014 at 09:08 AM 1
Share

That would be just a slider limited with value :) Here is a $$anonymous$$in$$anonymous$$ax slider to be clearer: http://i.stack.imgur.com/LRVi$$anonymous$$.jpg

avatar image HarshadK · Dec 05, 2014 at 11:27 AM 1
Share

$$anonymous$$isunderstood $$anonymous$$in$$anonymous$$ax Slider. Yeah, but a workaround off the top of my head is to have two sliders (one controlling $$anonymous$$ value and another max value) placed overlapping each other. Then user can drag the handles of these to set a value for these sliders. You can then control the value of slider user can drag for each slider via script such that user can not drag his handle from $$anonymous$$ value slider to a value greater than current value from max value slider.

avatar image Kiwasi · Dec 06, 2014 at 10:09 AM 0
Share

I agree, the duel slider approach seems best for this. If you like you can have a listener that sets the $$anonymous$$ value of the other slider to prevent overlapping.

You can also delete one of the background graphics.

avatar image
1

Answer by quansatthu · Dec 06, 2014 at 09:13 AM

Hello,

Code like this:

 public class NewGUI : MonoBehaviour {
      public float min, max;
      //public const float minLimit, maxLimit;
 
      void OnGUI () {
           EditorGUILayout.MinMaxSlider (ref min, ref max, minLimit, maxLimit);
 
           //min and max will now store the returning value of the use
      }
 
 }
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image vieirasub07 · Feb 26, 2017 at 01:38 AM 0
Share

Hello,

How can I change the slider's position??

avatar image
1

Answer by jmcorallo · Mar 26, 2017 at 05:53 PM

Hi, in case anyone needs a Min-Max slider in Unity 5, here's one I made: https://github.com/jmcorallo/unity-ui-elements

You can download the .unitypackage (version 0.1) directly here: https://github.com/jmcorallo/unity-ui-elements/releases/download/v0.1/UnityUiElements_v0_1.unitypackage

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image OMatthew · Apr 03, 2017 at 11:18 PM 1
Share

Great $$anonymous$$in-$$anonymous$$ax / two-sided slider. Exactly what I was looking for. Well done!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Horizontal Slider issue 0 Answers

Changing light intensity with a slider 2 Answers

How can i detect changes on a GUI slider? 1 Answer

How to make a Horizontal Slider slide between resolutions? 3 Answers

Adjusting a GUI slider with the arrow keys? c# 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges