There is an error that says
Assets/EnemyAttack.cs(39,28): error CS1061: Type PlayerHealth' does not contain a definition for
AddJustCurrentHealth’ and no extension method AddJustCurrentHealth' of type
PlayerHealth’ could be found (are you missing a using directive or an assembly reference?)
heres my code.
using UnityEngine;
using System.Collections;
public class PlayerHealth : MonoBehaviour {
public int maxhealth = 100;
public int curhealth = 100;
public float healthBarLength;
// Use this for initialization
void Start () {
healthBarLength = Screen.width / 2;
}
// Update is called once per frame
void Update () {
AddjustCurrentHealth(0);
}
void OnGUI(){
GUI.Box(new Rect(10, 250, healthBarLength, 20), curhealth + “/” + maxhealth);
}
public void AddjustCurrentHealth(int 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);
}
}
does anyone know why this is happening