Vylax
1
Okay, I got a 5x5 case boardgame, and I would like to register in a variable wich case my mouse is actualy over so I got this:
//case
//...
function OnMouseEnter () {
GMO.GetComponent(Shop).actualCase = gameObject;
}
//...
//Shop
//...
if(actualCase != null) {
if(Input.GetButtonDown("Fire1") && canBuy == true) {
Buy();
}
}else{
Debug.Log("no case selected ??!!");
}
//...
and I always get “no case selected ??!! UnityEngine.Debug:Log(Object) Shop:OnGUI() (at Assets/scripts/Shop.js:76)” instead of just clicking on a case to buy smthing…
What’s wrong in my scripts ?
Thx for reading
Vylax
2
Find the answer, unity want me to use GameObject.Find(“GameManager”)… Instead of the shortcut GMO.