title: Floating Problem With Rigidbody.Velocity in Unity
body: <p>Below is the code that I am using to move an object in Unity. The <code>rb.Velocity</code> line makes my object float in in Gameplay mode. If I comment out the line then the object falls just fine.</p>
  
  <p>Could someone explain whats happening here?</p>
  
  <pre><code>public class PlayerController : MonoBehaviour
  {
  
      public float forwardVelocity = 0F;
      public float maxSpeed = 180;
      public float acceleratePerSecond = 8.0F;
      public float rotateSpeed = 3.0F;
      private float yaw = 0.0f;
      private float pitch = 0.0f;
      protected Rigidbody rb;
      float timeZeroToMax = 2.5F;
  
      // Start is called before the first frame update
      void Start()
      {
          rb = GetComponent&lt;Rigidbody&gt;();
          acceleratePerSecond = maxSpeed / timeZeroToMax;
          forwardVelocity = 0F;
  
      }
  
      // Update is called once per frame
      void Update()
      {
  
              if (Input.GetKey(KeyCode.UpArrow)) //Accelerate The Vehicle
              {
                  if (forwardVelocity&lt; maxSpeed)
                  {
                  forwardVelocity += acceleratePerSecond * Time.deltaTime;
  
                  }
  
              }
  
  
          forwardVelocity = Mathf.Min(forwardVelocity, maxSpeed);
  
  
          rb.velocity = transform.forward * forwardVelocity;
  
  
          transform.Rotate(0, Input.GetAxis("Mouse X") * rotateSpeed, 0);
  
  
          yaw += rotateSpeed * Input.GetAxis("Mouse X");
  
  
          transform.eulerAngles = new Vector3(pitch, yaw, 0.0f);
      }
  
  }
  </code></pre>