Complete the code to declare a variable for the Animator component.
Animator [1];The variable name animator is commonly used to hold the Animator component reference.
Complete the code to get the Animator component from the GameObject.
animator = GetComponent<[1]>();Use Animator to get the Animator component attached to the GameObject.
Fix the error in the code to play the 'Jump' animation using the Animator.
animator.[1]("Jump");
The correct method to play an animation by name is Play with a capital P.
Fill both blanks to check if the Animator is currently playing the 'Run' animation.
AnimatorStateInfo [1] = animator.GetCurrentAnimatorStateInfo(0); if ([1].IsName([2])) { // Running animation is playing }
The method GetCurrentAnimatorStateInfo(0) returns a stateInfo object. We use IsName("Run") to check the animation name.
Fill all three blanks to set a boolean parameter 'isJumping' to true in the Animator.
animator.[1]("[2]", [3]);
Use SetBool to set a boolean parameter. The parameter name is isJumping and the value is true.