for my fighter script: the only way that I can get the animations to work is that I put the target.TakeDamage(weaponDamage); inside the previous function. when i add it to void hit the attack and animations wont play. With low health the enemy will die before i even strike them. anay idea? I have zero references to void hit() I added the public and it didnt help
private void AttackBehaviour()
{
if (timeSinceLastAttack > timeBetweenAttacks)
{
// This will trigger the Hit() event.
GetComponent<Animator>().SetTrigger("attack");
timeSinceLastAttack = 0;
target.TakeDamage(weaponDamage);
}
}
// Animation Event
public void Hit()
{
//target.TakeDamage(weaponDamage);
}