This is my code
bugAnimator.SetBool("Attack", true);
attackDelay += Time.deltaTime;
float maxAttackDelay = 3f;
if(attackDelay>= maxAttackDelay)
{
bugAnimator.SetTrigger("InitAttack");
gameMaster.TurretHealth -= Attack;
attackDelay -= maxAttackDelay;
}
It works very well but problem is that in moment that is health of player reduced(Turret Health) by enemy(bug) , enemy is beginning “swing” so some time is needed like offset before actually reducing health.
So how to run animation with some offset (does not matter if in script or animator controller)