Search Issue Tracker
By Design
Votes
4
Found in
4.6.0b18
Issue ID
634087
Regression
No
An object made using CanvasRenderer.SetVertices does not respond properly to GameObject.SetActive
To reproduce this issue:
1. Open the attached project
2. Open 'Test' scene
3. Press play
4. The red square is made using a UIVertex array and CanvasRenderer.SetVertices
5. After a second, the GameObject is deactivated using SetActive (false)
6. Button which is a child of this gameObject successfully disappears
7. But the red square remains visible instead of disappearing
Comments (1)
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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- The layout system is failing to correctly calculate or apply the height of the Japanese fallback font when the primary English font's metrics are used
PHARTGAMES
Jun 22, 2015 00:31
There's a couple of ways to work around this.
1. Add an OnDisable to your component and set a color with 0 alpha on the material that is assigned to the canvasrenderer (make sure you use an instanced or unique material),
2. Add an offscreen quad to the CanvasRenderer.SetVertices before the disable. You have to wait until the end of the frame before disabling your gameobject however, so use a coroutine with a yield return new WaitForEndOfFrame( );.
I ended up going with option 1 for simplicity