void OnMouseDown() { //Debug.Log(thyEnemyHealth.cointPoints); //This works! TODO: Conditions points to place defenses if (thyEnemyHealth.coinPoints >= 6) { if (turret != null) { Debug.Log("You cannot build there!"); return; } GameObject turretToBuild = BuildManager.instance.getTurretToBuild(); turret = Instantiate(turretToBuild, transform.position + positionOffset, transform.rotation * Quaternion.Euler(-90f, 0f, 0f)); thyEnemyHealth.GetComponent <Purse>().coinPoints = thyEnemyHealth.GetComponent <Purse>().coinPoints - 6; Debug.Log(thyEnemyHealth.coinPoints); } Debug.Log("You need more kills!"); }