Hello. I have multiple scripts within my game, and they are all accessing a single variable, a public money.
public float money;
The problem is that when I try to access this variable in other scripts, i.e:
GameObject dismaster = GameObject.Find("Master");
moneyComp = dismaster.GetComponent<GlobalMoney>();
dismoney = moneyComp.money;
It essentially creates a new variable in each script that has the same value as this global value is when it is assigned. It is reading said variable, but I need it to share the variable, and write back to this master. I suppose I could manually do it, but that seems extremely complex. Any ideas?