im trying to create a health bar using a tutorial i found but at “public void AdjustcurHealth (adj)” it says identifier expected
tutorial: http://wiki.unity3d.com/index.php/Health_Bar_Tutorial
help?
UPDATE: ok i got that fixed but now i got a new problem it says Unexpected symbol `/’
public class healthbar : MonoBehaviour {
private int maxhealth = 100;
public int curHealth = 100;
private float healthBarLength;
// Use this for initialization
void Start () {
healthBarLength = Screen.width / 2;
}
// Update is called once per frame
void Update () {
AdjustcurHealth(0);
}
void OnGUI (){
GUI.Box(new Rect(10,10, healthBarLength,20), curHealth.ToString "/" maxhealth.ToString);
}
public void AdjustcurHealth (adj) {
curHealth += adj;
if(curHealth > 0)
curHealth = 0;
if(curHealth > maxhealth)
curHealth = maxhealth;
if(maxhealth < 1)
maxhealth = 1;
healthBarLength = (Screen.width / 2) * (curHealth / (float)maxhealth);
}
}