x


Can't scroll ScrollView.

Hey guys.

I'm back with another problem but this one shouldn't be a difficult one. I made several Scrollviews in my script but for some reason I can't use the scrollbar to scroll through it.

One Scrollview for example looks like this:

function OnGUI(){
...
    AttachmentsScroll = GUILayout.BeginScrollView(AttachmentsScroll, GUILayout.Width(Screen.width/6), GUILayout.Height(Screen.height/5));
if(WeaponName=="AK"){
if(GUILayout.Button("AKAttachment1"));
if(GUILayout.Button("AKAttachment2"));
if(GUILayout.Button("AKAttachment3"));
if(GUILayout.Button("AKAttachment4"));
if(GUILayout.Button("AKAttachment5"));
if(GUILayout.Button("AKAttachment6"));
}
...
GUILayout.EndScrollView();
...
}

I can't see a problem with this part but when I went into the game nothing worked. Neither clicking with the mouse and dragging nor the scrollwheel or the arrow keys.

Does someone has an idea how to solve my problem.

P.S.: No ScrollView I ever made worked the one above is just my recent one.

more ▼

asked Jul 26 '12 at 01:33 PM

ExTheSea gravatar image

ExTheSea
1.9k 12 23 30

Why don't u copy the script pf the reference for scrollview?

Jul 26 '12 at 03:01 PM goo-muffin
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

My fault was that I declared the Scroll variable in the OnGUI function.

more ▼

answered Jul 26 '12 at 03:52 PM

ExTheSea gravatar image

ExTheSea
1.9k 12 23 30

(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:

x3678
x135
x1
x1

asked: Jul 26 '12 at 01:33 PM

Seen: 449 times

Last Updated: Jul 26 '12 at 03:52 PM