- Home /
Weird GUILayout Scrollview Behavior
Hi everyone, My scrollview script is acting weird. When I try to put a GUILayout.Box into void OnGUI it appears as an extremely tiny box and no matter what I do to it doesn't change. I can't quite figure out what's causing this. I think it might have something to do with the BeginScrollview function in my script but I'm not positive.
private Vector2 scrollPosition;
public int Switchint = 1;
void OnGUI()
{
GUI.BeginGroup(new Rect(525, 275, Screen.width/2,
Screen.height/2));
GUILayout.Box("20", GUILayout.Width(200));
switch(Switchint)
{
case 1:
scrollPosition = GUILayout.BeginScrollView(scrollPosition,
GUILayout.Width(150), GUILayout.Height(150));
GUI.EndScrollView();
GUI.EndGroup();
break;
case 2:
break;
case 3:
break;
default:
break;
}
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Player lives script help 1 Answer
Changing Axis to Buttons 2 Answers
Need help calling a script to another keep getting errors 1 Answer
Float not working all the time? 1 Answer