private void Jumping() { if (rpgCharacterController.CanStartAction("Jump")) { if (GUI.Button(new Rect(25, 175, 100, 30), "Jump")) { rpgCharacterController.SetJumpInput(Vector3.up); rpgCharacterController.StartAction("Jump"); } } }
void Update() { if (character != null) { RPGCharacterController controller = character.GetComponent <RPGCharacterController>(); controller.SetJumpInput(Vector3.up); if (controller.CanStartAction("Jump")) { controller.StartAction("Jump"); } } }
public void Moving() { moveInput = new Vector3(inputHorizontal, inputVertical, 0f); rpgCharacterController.SetMoveInput(moveInput); // Set the input on the jump axis every frame. Vector3 jumpInput = isJumpHeld ? Vector3.up : Vector3.zero; rpgCharacterController.SetJumpInput(jumpInput); // If we pressed jump button this frame, jump. if (inputJump && rpgCharacterController.CanStartAction("Jump")) { rpgCharacterController.StartAction("Jump"); } }