- Home /
 
 
               Question by 
               Screenhog · Jul 28, 2014 at 08:41 PM · 
                rendertexturescreenshot  
              
 
              Why can't I set RenderTexture.active?
I am trying to save a screenshot by using a RenderTexture. If I just want to save the current state of the screen, that works great, but when I want to save the image of a specific RenderTexture, I have been unsuccessful. No matter what I do, RenderTexture.active seems to equal "null".
Example code (the relevant portion of it):
  RenderTexture rt = new RenderTexture(Screen.width, Screen.height, 24);
  renderTexCamera.targetTexture = rt;
  renderTexCamera.Render();
  RenderTexture.active = rt;
  Debug.Log (RenderTexture.active); //Console says "null"
  Debug.Log (rt); //Console gives name of RenderTexture
 
               What's going on?
               Comment
              
 
               
              Your answer