GUITexture not displaying on active toggle

Hey guys,

I’ve got something odd going on.

prevButton.active = true;

The button remains invisible, but if i touch the screen it suddenly appears, or if i touch where it is (even while its still invisible) it all triggers as per normal.

Whats up with that?

Is there a way I can force a refresh/redraw/draw?

you can not force anything, you can only set the state.

If it does not react although you set it to active, I would check if something else is working against that, thats controlled by touch for example (another of your scripts)

Is prevButton a GameObject or a GUITexture?

The ‘active’ property of Components is deprecated, and I’ve had strange behaviour with it in the past.

For Components, use ‘enabled’ to toggle on/off.

For GameObjects, use ‘active’.

I definitely still check whether you have another script acting against it though.

GameObject…

Enabled is deprecated, active is the new one :slight_smile:

Disregard, some sloppy animation coding on my part :slight_smile:

Straight from the Component meta data:

Please use gameObject.active instead.

That’s what I did :slight_smile: