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

Camera

-

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

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.