Hi, I'm creating a 1x1 semitransparent white texture and using it to fill a 100x100 rectangle. This is the code
but when i run the game i get 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) UnityEngine.GUI.DrawTexture (Rect position, UnityEngine.Texture image)
asked Aug 13 '10 at 09:51 AM
You can't put GUI functions in Update. Also, creating a texture every frame is not a good idea.
answered Aug 13 '10 at 10:37 AM