I do not damage the "Enemy" (my script EnemyLogic inside)

using UnityEngine;
using System.Collections;

public class EnemyLogic : MonoBehaviour {
public int health = 100;

void Update()
{
if (health <= 0)
{
Dead();
}
}

void ApplyDamage(int damage)
{
health -= damage;
}

void Dead()
{
Destroy (gameObject);
}
}

My animation on “mace” (my weapon) works.
I havent any error.

Use code tags Using code tags properly - Unity Engine - Unity Discussions
Don’t add polls that serve no purpose.

It’s generally better not to do death checks in Upate. Just do them after you take damage.
Assuming this script is on the enemy, there doesn’t appear to be anything wrong, which means whatever script you are using to deal the damage from hitting the enemy isn’t right.

1 Like

Your ApplyDamage function is private, so nothing can access that function outside of EnemyLogic. How does the enemy take damage?

1 Like

Good point on the private. Overlooked that. But since OP reports no error, I’m guessing a call wasn’t being attempted.

Thank you all!
You’re amazing.