I have a metronome controlled by a GUI slider in my game. I have then displayed the value of the slider variable using GUI.Label. This works great, only the variable often has way to many decimals (i want it to have none). So obscure values come up for the value. Is there a way to preferably create a "snap to" GUI slider or just limit the no. of decimals to be displayed on the label? Any help will be greatly appreciated. Oh and I used variable.ToString() for displaying the variable in the GUI.
asked Sep 07 '10 at 09:14 PM
will specify 0 decimal places or the string (F2 will be 2 decimal places, etc. in case you ever need to do that)
To answer your comment - if you want it to snap to every 5, in your specific case:
Should do it