Right so the enemy attacks that’s not an issue, its the comunication between the AttackBehaviour script and the StrongEnemy one. What i’m trying to do is have the attack animation happen, and after its finished THEN the projectile comes out, rather than rn where they both happen at the same time so the animation is way behind.
Extra note Attack behaviour is directly attached to the StrongEnemyAttack animation in the StrongEnemy Animation controller. this is something i used so that when the enemy dies the death animation plays before the gameobject is destroyed, so its a bit annoying its not working here.
public bool attackReady;
public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
attackReady = true;
}
void Start()
{
AB.attackReady = false;
}
public void StrongAttacker()
{
if (StrongAttackChecker == 30)
{
StrongAnimation.SetTrigger("StrongAttack");
if (AB.attackReady == true)
{
Instantiate(ForgotPlantProjectilePrefab, LaunchOffSet.position, transform.rotation);
AB.attackReady = false;
}
}
}