0
\$\begingroup\$

How can I add a trigger variable negation in Animation machine's transition in Unity?

I have two transitions.

First happens if jump == false && grounded == true && duck == false && shoot, second happens if jump == false && grounded == true && duck == false && run == false. I want to change the second to the jump == false && grounded == true && duck == false && run == false && !shoot, i.e. add the trigger variable negation in the end.

How can I achieve this?

First

enter image description here

Second

enter image description here

\$\endgroup\$
1
\$\begingroup\$

Declare another Boolean and store the value of the trigger in that Boolean and then use it in the animator.

\$\endgroup\$
  • \$\begingroup\$ I need the trigger functionality. I want the animation to play once and transition further with the trigger being false. \$\endgroup\$ – some1 here Jan 9 at 10:03
  • \$\begingroup\$ How about making the second animation state as your default state and when the shoot trigger is activated it will transition to the first state. By definition the trigger after being activated once would revert back to a false state and your animator would transition back to the default state. \$\endgroup\$ – Amit Koranga Jan 9 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.