I set up a render texture for my main camera but now the camera can’t see anything. Here’s the code snippet. How do I get the camera view back? After running this code in the editor I see the gui but nothing else. I have to manually go choose the render texture which is listed as “none” in the inspector and then I can view what the camera used to see. When trying this on the iphone it doesn’t even render the gui.
What line of code am I missing?
var rt:RenderTexture;
var mycamera:Camera;
function Start () {
rt = new RenderTexture(Screen.height, Screen.width, 16);
mycamera= GameObject.Find("Main Camera").GetComponent(Camera);
mycamera.targetTexture = rt;
}