new void FixedUpdate() { if (_groundedState.IsGrounded()) { base.FixedUpdate(); } }
private void Jump(float thrust) { if (!_jumped) { if (_groundedState.IsGrounded()) { //TODO Make this if an option //if (_rb.velocity.y > 0) return; //if (_rb.velocity.y < thrust) //{ _rb.velocity += new Vector2(0, thrust); if (_rb.velocity.y > thrust) { _rb.velocity = new Vector2(_rb.velocity.x, thrust); } //} StartCoroutine(JumpedCoroutine()); } } }
void FixedUpdate() { if (_groundedState.IsGrounded()) { return; } if (_rb.velocity.y < -terminalVelocity) { return; } if (_rb.velocity.y > -terminalVelocity) { _rb.velocity -= new Vector2(0, gravity); } if (_rb.velocity.y < -terminalVelocity) { _rb.velocity = new Vector2(_rb.velocity.x, -terminalVelocity); } }