# RenderTexture.active not working on iOS

**URL:** https://discussions.unity.com/t/rendertexture-active-not-working-on-ios/116230
**Category:** Questions & Answers
**Created:** [September 8, 2014, 6:23pm UTC](https://discussions.unity.com/t/rendertexture-active-not-working-on-ios/116230 "2014-09-08T18:23:55Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Siflou](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@Siflou](https://discussions.unity.com/u/Siflou)
#### Post date: [September 8, 2014, 6:23pm UTC](https://discussions.unity.com/t/rendertexture-active-not-working-on-ios/116230/1 "2014-09-08T18:23:55Z")

</div>

Hey Guys,

I am trying to take a screenshot using a render texture. My code works fine in the editor and on Android too, but on iOS, I get a white texture. I am surprise because, when a texture is empty, I though that it was all black, so it seems like it captures something, but it is all white. Here is my code :

```
public IEnumerator TakeScreenShot()
	{
		yield return new WaitForEndOfFrame();
            mTex = new RenderTexture(Screen.width, Screen.height, 0);
		RenderTexture tempTexture = RenderTexture.active;
		RenderTexture.active = mTex;
		Camera.allCameras [0].targetTexture = mTex;
		RenderTexture.active = tempTexture;
		Camera.allCameras [0].targetTexture = null;

		gameObject.GetComponent<MeshRenderer> ().materials [0].SetTexture (0, mTex);
		gameObject.GetComponent<MeshRenderer> ().materials [1].SetTexture (0, mTex);

		StartAnimation ();
	}

```

Does anybody have an idea ? Thanks a lot for your time !

Claude

---

<div class="post-metadata">

### Author: ![Siflou](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@Siflou](https://discussions.unity.com/u/Siflou)
#### Post date: [September 8, 2014, 6:55pm UTC](https://discussions.unity.com/t/rendertexture-active-not-working-on-ios/116230/2 "2014-09-08T18:55:47Z")

</div>

Found it, the problem was not the RenderTexture.active, it was actually the part where I do my SetTexture, I replaced it with : SetTexture(“\_MainTex”, mTex); and it works like a charm. Thanks a lot !
