IEnumerator Jump() { isReadyToJump = false; allowJump = false; StartCoroutine(PauseJump()); onGrounded = false; onAir = true; mainCharacterAnimator.SetJumpAnimationParameter(true); yield return(new WaitForSeconds(1.2f / 36 * 8)); //play a part of animation before jump rigidbody.AddForce(transform.up * forceJump); }
private void OnTriggerEnter(Collider collider) { movementController.allowJump = true; mainCharacterAnimator.SetJumpAnimationParameter(false); }