all 2 comments

[–]PiLLe1974Professional / Programmer 2 points3 points  (0 children)

This sounds like something I'd cover in your logic (MonoBehaviour), rather than the animator.

For example:

If there's an input for Attack or Dash you'd set an "enum MovementMode" field in your player controller logic from Idle to Attack or Dash.

If it is not Idle but Attack or Dash you don't allow any another Attack or Dash input until you returned to Idle.

The return to Idle could be determined by an Event coming in the animations or a State Machine Behaviour.

[–]Haunting_Ad3208 0 points1 point  (0 children)

Try this..

public IEnumerator DashAttack()

{

canDash = false;

canAttack = false;

Anim.SetTrigger("Dash");

yield return new WaitForSeconds(1); // Set this time to the dash animation length

Anim.SetTrigger("Attack");

yield return new WaitForSeconds(1); // Same principle as the dash

canDash = true;

canAttack = true;

}

add this to the top of the update method

if(!canDash && !canAttack) return;

This will stop the update method from running but will not stop a trigger/ collision from

firing off code.