I’m making a Quake style console, as my first Unity project. I’m totally new here. I made a GameObject and attached the following script to it:
#pragma strict
var consoleBackground:Texture;
function Start()
{ consoleBackground=Resources.Load("ConsoleBackground", Texture);
}
function Update()
{
}
function OnGUI()
{ GUI.DrawTexture(Rect(10, 10, Screen.width, Screen.height/2), consoleBackground);
GUI.Label(Rect(10, 10, Screen.width, Screen.height/2), "Hello World!");
}
Upon running, I get: “null texture passed” warning in console output. There is a ConsoleBackground.png file in the Assets folder. What’s wrong? XD