// Update is called once per frame void Update() { float x = Input.GetAxisRaw(h); float z = Input.GetAxisRaw(v); movement3D.SetDirection(new Vector3(x, 1, z)); if (Input.GetKeyDown(KeyCode.Space)) { movement3D.Jump(); } }
public void PlayerJump() { if (!movement3D.characterController) { return; } if (Input.GetKeyDown(JUMP_KEYCODE)) { movement3D.Jump(); if (movement3D.characterController.isGrounded) { playerAnimator.animator.SetTrigger("Jump"); } } playerAnimator.animator.SetBool("Ground", movement3D.characterController.isGrounded); }