Hello, I have animation, animation code and enemy health code.
Animation Code
void Update () {
if(Input.GetButtonDown ("Fire1"))
{
CurrentWeapon.animation.CrossFade("P_axe_anim");
}
Health Code
void OnTriggerEnter (Collider other)
{
if (other.collider.tag == "Weapon")
{
Health--;
Debug.Log (Health);
}
}
This is health code but Health variation never decrease. It’s my problem. And this codes in different files.