- Home /
.enabled does not enabled GUItexture
Howdy,
I'm using textureName.enabled = true; to enabled/disable a GUITexture, problem is, this isn't doing anything! I have another script in my project that is performing a similar thing and working fine, but this time it is not doing anything!
The only way I can get it to work is to use .active which Unity tells me is deprecated and should not be used, what am I doing wrong?
:O
Answer by Mike 3 · Feb 02, 2011 at 04:41 AM
It sounds like you're mixing enabled and active - I would guess that the GameObject the GUITexture is assigned to is inactive.
You could use yourGUITexture.gameObject.active to set the active status, which wouldn't give you the warning
Alternatively, you could set the GUITexture as disabled instead of inactive (assuming you did it int he editor), by unticking the box next to the GUITexture, instead of the GameObject
Your answer
![](https://koobas.hobune.stream/wayback/20220613102403im_/https://answers.unity.com/themes/thub/images/avi.jpg)