Array displaying error in gui.box [Resolved]

General Discussion on the Unity Engine.
Post Reply
User avatar
Callan S.
Posts: 2043
Joined: Sun Jan 24, 2010 5:43 am

Array displaying error in gui.box [Resolved]

Post 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!
Last edited by Callan S. on Thu Jun 14, 2012 12:22 am, edited 1 time in total.
User avatar
Callan S.
Posts: 2043
Joined: Sun Jan 24, 2010 5:43 am

Re: Array displaying error in gui.box

Post 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.
Post Reply

Return to “General Unity”