- Home /
guiTexture.enabled (am I an idiot???)
hey guys,
i am doing here a little project, i attached this c# script to the maincam object:
public GUITexture Beenden;
void Update () {
if(Input.GetKeyDown(KeyCode.Escape))
{
Beenden.enabled = true;
// Beenden.pixelInset = new Rect(Screen.width/2, Screen.height/2, 600, 600);
Time.timeScale = 0;
}
}
so i added my favored guiTexture as value to "Beenden" and in the Unity Enviroment, but when i press Escape it doesn´t enable it. First I thougt that it didn´t get into the if-statement, but i did a print command and that worked very well.
hope you can help me, and sorry for bad english.
Answer by zzeettoo · Apr 27, 2013 at 08:47 PM
enabled just says if this component is updated anymore or not. It seems to me, that you dont want to control the update behaviour but you want to turn on and off the whole GUITexture object?! In this case, simply work with .active for the gameobject instead of .enabled
thank you! in this case this was not my problem, i just attached the guitexture from the assets folder, not this one from the scene!
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Toggle GuiTexture 1 Answer
Removing a GUITexture a set amount of time after it has been enabled. 1 Answer
Gui Texture Differences 1 Answer
ASPECT RATIO FILTER IN OnGUI? 3 Answers