L
L
Lord_North2019-08-30 18:38:01
C++ / C#
Lord_North, 2019-08-30 18:38:01

How to check if animation is active in if?

If so, it throws an error...

if (Input.GetButton ("Jump") && grounded) {
      if (!animator.SetBool("IsJumping")) {
        animator.SetBool("IsJumping", true);
      }
    }
    if (grounded){
      animator.SetBool("IsJumping", false);
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Gaydak, 2019-08-30
@Lord_North

and take not Bool, but a trigger.
animator.SetTrigger
resets itself after navigating it.
affixed -> the animator has moved on the trigger and will reset it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question