RenderTexture on RawImage shows black on Android/iOS and WebGL except in Editor Mode

Hi there,

We’re on Unity 2021.3.14f1

We have a camera that views the avatar of the player.

This camera has Target Texture which is a RenderTexture asset in our project.

This RenderTexture asset is then referenced in a RawImage component.

Long story short in the Editor view we can see the avatar and everything works as intended.

When we build our game into WebGL, Android or iOS the RawImage show pitch black instead.

I’m looking for some advice on solving this issue. Below I’m attaching some screenshots to give more information.

-We have already tried changing the color format and depth stencil format which had no effect on the matter.

-We also tried adding a material (a default sprite material) to the RawImage component and that also had no impact on the matter.

Hello @tuncturelFlavour . Try following this steps:


1 - create a new Render Texture (don’t change anything on it).


2 - Create a new Ui canvas with just one element UI/Raw Image.


3 - Create a new camera and now: put the renderTexture on both the camera’s Target Texture and the rawImage’s
Texture fields.


PS: have sure that you have this UI element above everything else and that you don’t change anything else than steps 1 to 3. Test it and give me feedback. Also, are you using URP or Built-in renderer? We have to see some of your configs for rendering on mobile. Also your culling mask can be a problem.