Unity Community


Results 1 to 2 of 2

Thread: GUI slider


  1. Posts
    584

    GUI slider

    So Im not sure how to do this so im going to ask here. I'm trying to use a GUI slider to change to speed of the game. What would this script look like? So like you would change the timescale from a % of 1 to 3, so ur bar would be doing all numbers between 1 and 3, speeding it up as it is farther scrolled.
    Note: I want a horizontal slider, so if u post code make it horizontal for ease of use


  2. Location
    Vilnius
    Posts
    77
    Here is scripting reference page about sliders : http://unity3d.com/support/documenta...talSlider.html

    Code:  
    1. function OnGUI () {
    2.     Time.timeScale = GUI.HorizontalSlider (Rect (25, 25, 100, 30), Time.timeScale, 1.0, 3.0);
    3. }
    Please correct my english if I write something wrong. Just learning
    Unity Pro + Unity iOS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •