- Home /
gameObject.SetActive() or CanvasRenderer.SetAlpha() for visibility
Which one is better for just changing visibility? Lets assume that the gameobject has no scripts on it other than an Image or Text script
TY!
Comment
Answer by $$anonymous$$ · Jun 04, 2015 at 02:56 PM
I would use SetActive, mainly because some UI elements can block raycasts.
Your answer
![](https://koobas.hobune.stream/wayback/20220613200619im_/https://answers.unity.com/themes/thub/images/avi.jpg)