This script is suppoused to activate a button, from a value of 25, if the value is to low, it’s suppoused to activate something else.
using UnityEngine;
using System.Collections;
public class RepairBuyButton : MonoBehaviour {
public GameObject cam;
public GameObject BuyButton;
public GameObject NotReadyToBuy;
public void BuyItemButton()
{
if (playerMoney.money >= 25)
{
BuyButton.SetActive (true);
}
else
{
NotReadyToBuy.SetActive (true);
}
}
}
The line with: if (playerMoney.money >= 25) is telling me :An object reference is required to access non-static member `playerMoney.money’. Help is appreciated.