- Home /
camera.targetTexture = null crashes on Android
Hi,
I have a bunch of UI that gets rendered with a camera and a 3D character that gets rendered with another camera.
I need a screenshot thumbnail of the character, so I set the camera targetTexture to a new RenderTexture and read the pixels from it and store it in a Texture2D, and set the targetTexture back to null.
All this works in the editor, on the web and on iOS. But on Android it crashes the next frame it needs to render. If I comment the targetTexture = null part then it does not crash but my camera does not render to the screen anymore.
Any idea?
Answer by jhincapie · Jul 04, 2017 at 08:19 AM
Did you ever fix this problem?
This question is pretty old, so I don't remember if I fixed it. But normally if I fix my own question I post it as an answer aswell. So I guess I did not fix it. Not sure though.
Thanks! I just encountered the same problem. I will post the answer once I fix it.
Your answer
![](https://koobas.hobune.stream/wayback/20220613135258im_/https://answers.unity.com/themes/thub/images/avi.jpg)