does anyone know what is wrong with this script.

var normalTex : Texture2D;
var hoverTex : Texture2D;
var player_money : Rect = new Rect (0, 0, 0, 0);
static var ShopOn = false;
var InputText : GUIText;
private var inRange = false;
function OnMouseEnter () {;
guiTexture.texture = hoverTex;

function OnMouseExit(){
 guiTexture.texture = normalTex;
   function OnMouseDown(){
   if(player_inventory.con_price >= player_inventory.player_money)
      inRange = true;
      InputText.text = "not enough money!";
      yield WaitForSeconds(1.5);
      print ("not enough funds");
       if(player_inventory.player_money >= player_inventory.con_price)
       print ("con bought");
       player_inventory.player_money -= 33;


the error is in line gameObject.Find(“con_text”).gameObject.GetComponent(“home_script”).gameObject.SetActive(true); does anyone know what is wrong with the script?? i made sure it was spelt right

The line you indicate should be executed in a function. Start() would be a good place. And the line should be:


No need for the extra ‘gameObject’, and no quotes around ‘home_script’. I’m assuming that your ‘home_script’ has a variable called SetActive, and that you are not trying to use the GameObject.SetActive(). Or if you are trying to disable the script, it should be ‘.enabled = false’.