So I’m writing a GUI script to show some stuff and I write the first line of my GUI and it gave me a curious error that makes no sense to me at all.
And this is the script I’m using:
[color=gray][i]function Update ()
{
}
[/i][/color]
[color=blue]function [b]OnGUI[/b][/color] ()
{
[color=green]//Texts[/color]
[color=blue][b]var[/b][/color] text1 = [color=purple]"testest"[/color];
[color=blue]GUI.Box[/color] ([color=blue]Rect[/color]([color=teal]10, 10, 50, 10[/color]), [color=purple]"Test"[/color]);
}
Instead of GUI.Box use GUI.Label
If I do “Rect” it says the same thing, plus I like using the box because thats how I have always done it.
Aerozo
March 15, 2011, 1:25am
5
My guess is that it’s because you called your script GUI.js
Up that was it, why does that error it up? Never have seen that before in Unity.
Thanks BTW
I also need an answer on this post if you guys will take a look:
http://forum.unity3d.com/threads/81867-Creating-an-outline-on-an-object-when …?p=523714#post523714
Because Unity doesn’t know that you mean UnityEngine.GUI. You can either spell it out like that, or not use class names for your own stuff which is the same as Unity class names.
–Eric