private void UpdateVerticalSpeed() { // TEMP //if ( _jumpInput ) //{ // _verticalSpeed = MovementSettings.JumpSpeed; // IsGrounded = false; //} if (IsGrounded) { _verticalSpeed = -GravitySettings.GroundedGravity; if (_jumpInput) { _verticalSpeed = MovementSettings.JumpSpeed; IsGrounded = false; } } else { if (!_jumpInput && _verticalSpeed > 0.0f) { // This is what causes holding jump to jump higher than tapping jump. _verticalSpeed = Mathf.MoveTowards(_verticalSpeed, -GravitySettings.MaxFallSpeed, MovementSettings.JumpAbortSpeed * Time.deltaTime); } //var gravity = -GravitySettings.MaxFallSpeed; //if (_jumpInput) //{ // gravity /= 30; //} //_verticalSpeed = Mathf.MoveTowards(_verticalSpeed, gravity, GravitySettings.Gravity * Time.deltaTime); var gravity = (UnlockManager.Get(typeof(UnlockableGlide)) as UnlockableGlide).Try(_jumpInput, -GravitySettings.MaxFallSpeed); _verticalSpeed = Mathf.MoveTowards(_verticalSpeed, gravity, GravitySettings.Gravity * Time.deltaTime); } }