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
- Volumetric fog shader variants are missing from build when "Strict Shader Variant Matching" is disabled
- Unnecessary modifications clutter the Scene when using a RectTransform driven by a LayoutGroup in a Prefab
- Files in the target folder are deleted without a proper warning when building an iOS project
- Character animation freezes when toggling animator on/off in a coroutine
- Certain textures are incorrectly marked in the render pass list when observed through Render Graph Viewer
Add comment