I have a scene where i want to set up a second camera screen, kind of illustrating something else that’s happening somewhere else in my game. I found a tutorial that helped me understand the concept. But that tutorial is good if you want to have in-game objects (like monitors) to display whatever camera they want to display. But I want to have the render texture be displayed on the top right corner of the screen. I created a script and managed to get the render texture like a GUI, but the problem is that it renders it transparent and i want it to be displayed solid.
This is the code I have right now. I have it attached to an empty game object.
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class GUIWindow : MonoBehaviour {
public RenderTexture r_texture;
public Texture2D t2d_BackgroundTexture;
public Texture2D t2d_texture;
public Rect windowDimensions;
// Update is called once per frame
void OnGUI () {
//GUI.Window ();
GUI.DrawTexture(windowDimensions, r_texture);
GUI.DrawTexture(windowDimensions, t2d_texture);
}
}
Is there a way to remove all transparency so that I can have my other camera display things correctly?