Search Issue Tracker
By Design
Votes
0
Found in
2017.4.0f1
2018.2.14f1
2018.3.0a1
2019.1.0a1
Issue ID
1099664
Regression
No
In Editor, SetActive(true) does not work when it is called the first time
How to reproduce:
1. Open attached project "setActiveFalse_firstTime7.zip" and scene "FloorMap00"
2. Enter Play mode
3. In Game View, press on "Asset Tracking" button
4. Observe Console window (the image SetActive(true) was called, but it never showed up)
5. In Game View, press on "X" button
6. Repeat step 3-4 (the image shows up)
Expected result: after pressing on "Asset Tracking" button the image pops up
Actual result: the first attempt of pressing on pressing on "Asset Tracking" button the image did not show up
Reproducible with: 2017.4.16f1, 2018.3.1f1, 2019.1.0a12
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Custom ScriptableObject asset in the project setting are not well deserialized during the Reimport All process
- Fixing Message Loss in UMPE During Domain Reload
- The Editor freezes when ScheduleReadOnly of IJobParallelForTransform with dependency is used
- Text is truncated in the Inspector when the display scale is set to 150%
- CancellationTokenSource(<timeout>) has incorrect cancellation status when used in WebGL Player
Resolution Note:
This is by design. gameObject.SetActive(false); is called in Start() of the MonoBehaviour that SetActive(true) is called on.
First time gameObject.SetActive(false), Start() will be called and then the gameObject will be disabled immediately. The second time gameObject.SetActive(false) is called, Start() has already been called and won't be called again. So SetActive(true) works the second time because gameObject.SetActive(false) isn't called afterwards.