I use the following codes to create a 2D menu ( script attached to Main Camera ):
public class MyScene : MonoBehaviour {
public Texture backgroundTexture;
void OnGUI() {
// display bg texture
GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height),
backgroundTexture, ScaleMode.StretchToFill);
}
}
I have a 3D model that has to be placed in front of this background image. I tried to place the 3D model in front of the Main Camera, but once the background image is loaded, the 3D model disappears / hide behind the background image.
What should I change ?