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
- “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
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.