- Home /
getting !slot->GetLocalAABB().IsValid() and isFinite() errors with GUI Buttons
Hey, I was wondering if anybody knows whats going on. I have a GUI Script that seems to be causing the !slot->GetLocalAABB().isValid() and !isFinite() errors. I've tracked the cause of the error to a small gui script where I use Buttons. It is a GUILayout.Button(), however, it can be caused through GUI.Button as well. Any thought? here is the piece of code:
var selectedLevel : boolean = false;
function Update () {
if(selectedLevel)
{
gO.GetComponent("recycleController").selectedLevel = true;
gO.GetComponent("recycleController").level = level;
this.enabled = false;
}
}
function OnGUI() {
if(!selectedLevel)
{
GUILayout.BeginArea(Rect(Screen.width/2 - 150,Screen.height/2 - 150, 320, 320));
GUILayout.Box("Please select your difficulty");
if(GUILayout.Button("Easy")) {selectedLevel = true;level=1;}
if(GUILayout.Button("Medium")) {selectedLevel = true; level=2;}
if(GUILayout.Button("Hard")) {selectedLevel = true; level=3;}
GUILayout.EndArea();
}
}
Comment