Odd flickerin in builds, with internal texture...

So I code in C# and I create a new texture like this:

using UnityEngine;
using System.Collections;

public class example: MonoBehaviour
{		
	// Gui stuff
	private Texture2D MyTexture;

	// Debug GUI. Disable when not needed.
	void OnGUI ()		
	{	
		MyTexture = new Texture2D(8,8);
		GUI.DrawTexture(new Rect(10, 30, 100, 10), MyTexture);
		// rest of the code...
	} 
}

In editor it works perfectly, I can use this texture for progresbars etc.

Heres a demonstration:

Left in build, right in editor.
Any ideas?
but in a build the texture flickers with some sort of circles, sort of reminds me of old mipmaping bugs

Just take the ‘new Texture2D…’ line out of the OnGUI call for a start. :slight_smile:

Initialize it only once:

void Start() {
    MyTexture = new Texture2D(8,8);
}

Looking better indeed, but still some strange horizontal fading in the center of the texture, where the whole texture should jsut be a solid color. Any ideas?

If your texture indeed contains only one color, consider tweaking additional parameters of GUI.DrawTexture method.