Search Issue Tracker
By Design
Votes
0
Found in
2017.1.0f3
Issue ID
951830
Regression
No
Setting Camera.targetTexture to null makes its target object invisible
To reproduce:
1. Open attached Unity project "RTReplace.zip"
2. Open "0" scene
3. In the Hierarchy, navigate to Canvas --> RawImage
4. In RawImage Inspector, change Texture from RT1 to none
5. In the ChangeRT script of the Camera object, uncomment line saying "Camera.main.targetTexture = null;"
6. Go into Play mode
Expected result: RawImage should stay active and visible
Actual result: RawImage disappears instantly after starting Play mode and it is invisible in scene view too, despite that there is no place in the code that could trigger this behaviour (see attached gif "bug.gif")
Workaround: Making Camera.targetTexture wait a few frames until setting it to null does not reproduce the issue (see attached gif "nobug.gif")
Reproduced on: 5.6.3p3, 2017.1.1p2, 2017.2.0f1, 2017.3.0b1
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Add comment