Hello, i've made research but i didn't find anything similar.
I want to create UI slider with different value arrangement.
Therefore, roughly said, i want to set 5% of value to be shown on first 20% slider, and other 95% of value to be shown on the remaining 95% of slider bar image, but with gradually transition if it's possible.
I think this is very hard question, but please help if you have some idea. :/ :)
Answer by UnityCoach
Apr 10 at 04:17 PM
So, if I sum it up, you want :
0 = 0
20 = 5
60 (((100-20)/2)+20) = 52.5 (((100-5)/2)+5)
100 = 100
The best way I know to manage arbitrary value mapping is using AnimationCurves.
So, you can have a UI Slider go from 0 to 1 in a linear way, but have a script give you a value modified with an AnimationCurve, using AnimationCurve.Evaluate (value).
Thank you so much, i havent worked with curves but 'i'll give my best!
AnimationCurves and Gradients are so handy.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
4 People are following this question.
Should I use the UI as a game space?
GUI not appearing in exported game
Access text label inside a button - Unity 5.1.4
Android performance hit on changing Button.Interactable
Canvas is hiding my 3D model, can I place the model in front of the canvas?