x


How do GUI Sliders work

how does a GUI slider work? i tried this:

var Number = 10;
function OnGUI () {
Number = GUI.VerticalSlider(Rect(10,10,40,200),Number,20,0);
print(Number);
}

but it wouldnt work, any reason why?

(in otherswords, how do you use a GUI slider, noob question i know but i cant find it ANYWHERE, and yes i did read the wiki and the runtime class available on resources)

more ▼

asked Apr 15 '10 at 02:49 AM

Adam Bruns gravatar image

Adam Bruns
274 24 27 38

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

"Number" is a particular system type, and you can't use it as a variable name. This is one of several reasons why it's a good idea to always use lowercase for variable names.

more ▼

answered Apr 15 '10 at 03:05 AM

Eric5h5 gravatar image

Eric5h5
80.3k 42 132 521

(comments are locked)
10|3000 characters needed characters left

I think "Number" is JavaScript type. Try renaming "Number" to something else, like "number".

more ▼

answered Apr 15 '10 at 03:06 AM

Molix gravatar image

Molix
4.8k 17 27 66

thank you you two, now it makes sense

Apr 15 '10 at 03:33 AM Adam Bruns
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3695
x108
x103

asked: Apr 15 '10 at 02:49 AM

Seen: 3669 times

Last Updated: Apr 15 '10 at 02:49 AM