Hi, I am ttrying to create a RollOver script to go with my Interface that I can apply to the top most hiearchy (ie menu>elements) then call the elements I want [ie so I dont have to place button scripts on every element just to have rollovers.
I am pretty new to the scripting part but I managed to create a rollover that works somewhat. However, I am trying to call some gameObjects in the scene and then enable disable them depending on the rollover. Hoever I keep getting erros that UNITY cannot find my the variables “enabled”. Here is the code I have:
var normalTexture;
var hoverTexture : GUITexture;
var pressedTexture : GUITexture;
var messagee : GameObject;
var message = "ButtonPressed";
var menuBkg;
private var state = 0;
private var myGUITexture : GUITexture;
//menuBkg = GameObject.find("menuBkg");
//myGUITexture = GameObject.find("APUprogr0");
function Start() {
menuBkg = GameObject.Find("menuBkg");
normalTexture = GameObject.Find("menuBkg/APUcmplte1");
}
var highlightColor = Color.yellow;
function OnMouseEnter () {
hoverTexture.color.a = 0;
normalTexture.enabled = false;
Debug.Log("hi"+ menuBkg);
}
function OnMouseExit () {
hoverTexture.color.a = 100;
}
The problem arises when the normalTexture element is called…take it out its ok. This script is place at the topmost chain and looks for elements within that hierarchy.
I appreciate any help and tahnks in advance.