turning on a game object throu script

i am attempting to turn on a GUITexture throu script

the related code to this is

var hudCharge : Texture2D[];
var chargeHudGUI : GUITexture; 

function HUDon(){
	if(!chargeHudGUI.enabled){
		chargeHudGUI.enabled = true;
		
	}
}

upon running some debug code i have tracked it back to this function, and im not sure where to look for this answer as i do not know what to search under.

it renders fine i can turn it on and off in the inspecter but this code wont turn it on i want to hide the GUI until a certian moment in game play then turn it on. basically in code i want to place the check mark on the box to render it on screen

I would wrap them in conditions and once the conditions are true they will render.

i was able to get it figured out thank you for pointing me in the right direction. i think i have it marked as answered by you if not ill be nack soon to fix it.

would you copy and paste your replys as a answer so i may check mark it thank you it was very helpful.

You can close the question and for reason say "question answered in form of comment by.." I was off watchin a movie,lol. I will do so, and thank you!

1 Answer

1

I would wrap them in conditions and once the conditions are met they will render. This will avoid trying to make things enabled(if even possible).