What’s up here? I have a button that I press to show/hide a info object. It works the first time I press but not afterwards, I don’t see the problem:
var currenttexture : Texture2D; var newtexture : Texture2D; var self : GameObject; var myCheck : boolean = true; var info : GameObject; function OnMouseEnter () { self.renderer.Material.maintexture = newtexture; } function OnMouseExit () { self.renderer.Material.maintexture = currenttexture; } function OnMouseDown () { if(myCheck){ info.guiText.enabled = true; mycheck = false; }else{ info.guiText.enabled = false; mycheck = true; } }
Also the first part is supposed to change the button appearance but not working either. Thanks for any help!