ScrollView not working in a GUI Window

Right now I have a Window that represents a Button list like thingy… here’s an example

private var ContainerWindow = Rect(5,5,250,200);
public var ContainerID = 1;

private var ScrollPosition = Vector2.zero;

function OnGUI(){
		ContainerWindow = GUI.Window(ContainerID,ContainerWindow,GetBox,"Box"
}

function GetBox(){
	ScrollPosition = GUI.BeginScrollView(Rect(5,20,240,170),ScrollPosition, Rect(0,0,220,750));
            GUI.Button(Rect(10,50,50,50),"1");
            GUI.Button(Rect(10,100,50,50),"2");
            GUI.Button(Rect(10,150,50,50),"3");
            GUI.Button(Rect(10,200,50,50),"4");
            GUI.Button(Rect(10,250,50,50),"5");
            GUI.Button(Rect(10,300,50,50),"6");
            GUI.Button(Rect(10,350,50,50),"7");
            GUI.Button(Rect(10,400,50,50),"8");
            GUI.Button(Rect(10,450,50,50),"9");
            GUI.Button(Rect(10,500,50,50),"10");
            GUI.Button(Rect(10,550,50,50),"11");
            GUI.Button(Rect(10,600,50,50),"12");
            GUI.Button(Rect(10,650,50,50),"13");
            GUI.Button(Rect(10,700,50,50),"14");
	GUI.EndScrollView();
	GUI.DragWindow(); //<DragWindow used AFTER Begin End Statements\\
}

No errors, however when I click the scrollbar it wont do anything even if I use mousewheel.
–It dosent drag the window.

Any suggestions?

Yeah, Me too…

Does it seem to be the same as the issue in this thread? This was supposed to have been reported as a bug, but it may be that this has slipped through the net somehow.

Yes, this seems to be what I’m looking for, did they not fix this or do I just have bad luck?
Thanks

It’s possible this wasn’t caught - I’ll see if a member of the dev team can shed any light on this.

Cool, Thanks!

Any word on this bug?

Don’t know never got mine working… still keeping an eye out for it though…

Same problem here.

Is this still not working in the latest Unity? I’ll poke the support team if not.

I found a similar problem using the GUILayout variant of these: the problem is that the objects contained within the scrollview have been created with absolute x and y locations so the scroller does not see any content overflow.

I cured this by using

GUILayout.Button(“string 1”);
GUILayout.Button(“string 2”);
GUILayout.Button(“string 3”);

GUILayout.Button(“string x”);

The objects are then created using x and y positions relative to scrollPosition thus allowing it to see the overflow and actuate the scrollbar :slight_smile:

I’m not sure if the same methodology will work for the vanilla GUI methods or if it can only be done via GUILayout.