Render texture is not rendering Terrain

I have a mini map that it using a render texture for the OnGUI function. The texture is fine when I look at it in the inspector but it’s not showing up in the game view. Apparently this is a bug. I’ve tried using Graphics.DrawTexture but that doesn’t seem to work either. If anyone has any ideas that would be awesome.

P.S I have to use OnGUI.

Thank you.

Try using this code. Make sure to set the Material to Unlit/Texture, if you use the normal Diffuse, this will not work.

using UnityEngine;
using System.Collections;

public class MinimapTest : MonoBehaviour
{

	public Material aMaterial;
	public Texture aTexture;
	void OnGUI ()
	{
	
		Graphics.DrawTexture(new Rect(100,100, 128, 128),aTexture, aMaterial);
		
	}
}

Are you prass the play button?

If you not to prass that.

Or if you want to preview but not prass the play button, you can add this to you script in top.

@script ExecuteInEditMode()