Page 1 of 1

Array displaying error in gui.box [Resolved]

Posted: Wed Jun 13, 2012 2:37 am
by Callan S.
I can't get this to work, which seems absurd since it's so simple

Code: Select all

GUI.Box (Rect (10,100,200,100), "###"+stepsx[0])
But I get this error

Code: Select all

NullReferenceException: Object reference not set to an instance of an object
Boo.Lang.Runtime.RuntimeServices.InvokeBinaryOperator (System.String operatorName, System.Object lhs, System.Object rhs)
databaseinteract.OnGUI () (at Assets/AAA My new scripts/databaseinteract.js:103)
:evil:

What's going on? Thanks!

Re: Array displaying error in gui.box

Posted: Thu Jun 14, 2012 12:21 am
by Callan S.
Okay, what happened was apart from wanting the variable defined as an array, it also wanted some value plugged into it other wise it throws a hissy fit. So I made a Start () function and put a for loop inside to make them all set to zero. I'm not sure if there's a better way than that (seems kind of awkward). Anyway, resolved.