private void Update()
 {
     if (Player.CanControlPlayer)
     {
         // Check if jumping
         if (IsGrounded && Keybinds.JumpDown())
         {
             // Queue a jump for the next FixedUpdate
             // Actual jumping done in FixedUpdate to stay in sync with PlayerGroundedChecker
             jumpQueued = true;
         }
         else
         {
             jumpQueued = false;
         }
         // Check if sprinting
         if (Keybinds.Sprint() && PewterReserve.HasMass)
         {
             IsSprinting = true;
         }
         else
         {
             IsSprinting = false;
         }
     }
 }
Example #2
0
 private void Update()
 {
     if (IsGrounded)
     {
         // Jump
         if (Keybinds.JumpDown())
         {
             rb.AddForce(jumpHeight, ForceMode.Impulse);
             groundedChecker.AddForceToTouchingCollider(-jumpHeight);
         }
     }
 }