1
\$\begingroup\$

The animator of my character gets stuck from time to time into the first attack animation instead of transitioning to the next one, even if the condition of transitioning is met. This problem gets resolved if I keep the transition condition met for a few seconds, but this can't be tolerated because i'm having a combo and the player can't be just be holding left click for seconds to continue the combo. Here's a screen showing where the Animator gets stuck and the transition doesn't pass:

Unity Animator

I should also note that I can't just uncheck Exit Time because I can't let the player skip an attack animation within a combo.

I've got a Hit boolean that is set to true when the player left clicks. That is the condition for continuing the combo and for getting back to idle state I have a FinishCombo.

Unity Animator with conditions

This condition is triggered when the player left clicks.

\$\endgroup\$
2
  • \$\begingroup\$ Can you give us more information on your transition conditions and how you meet them? \$\endgroup\$
    – Philipp
    Oct 21, 2021 at 7:02
  • \$\begingroup\$ sure. a sec i'll post update to my question with images \$\endgroup\$
    – TensaDev
    Oct 21, 2021 at 7:09

1 Answer 1

4
\$\begingroup\$

I think you'll want to make your Hit variable a trigger, not a boolean.

You can enable the trigger with SetTrigger and it will stay "armed" until it reaches a transition that uses it, then "discharge" back to its default off state.

This lets you get the effect of holding the boolean to true until you reach the exit time of the animation, but automatically, and without allowing a single hit to trigger more than one transition.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .