Hi,
I’ve made a script for a teleport.When i touch a special object,it should draw a Texture (imitates a load screen),then it wits 5 seconds and then it teleports you to the next Level. But i get an Error:
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.GUI.DrawTexture (Rect position, UnityEngine.Texture image, ScaleMode scaleMode, Boolean alphaBlend, Single imageAspect) (at C:/BuildAgent/work/812c4f5049264fad/Runtime/ExportGenerated/Editor/GUI.cs:155)
Teleport+$OnTriggerEnter$1+$.MoveNext () (at Assets/scripts/Teleport.js:4)
script:
var Lade : Texture;
function OnTriggerEnter (other: Collider){
GUI.DrawTexture(Rect(10,10,100,100),Lade,ScaleMode.ScaleToFit,true,10.0f);
yield WaitForSeconds (5);
Application.LoadLevel(1);
}