
This becomes a pain if you want it to stop turning - a simple trick is to set freezeRotation to true if you're not turning and false if you are. If you want to actually change the forward direction, you could use torque. rigidbody.AddRelativeForce(Vector3(10,0,0)) is the same as rigidbody.AddForce(transform.right * 10)

In all physics-function-based approaches, momentum will be conserved, meaning that any forces or changes applied will not alter the motion that was applied previously unless they are applied in an opposing direction.ĪddRelativeForce will add force (given in the relative coordinate system) to existing forces. Note that setting the velocity manually will result in unnatural physics simulation. You might even want to change the speed calculated with gravity according to the buoyancy of your object relative to the matter in which it is acting (air, water, etc.) and the side that is facing that direction. store the direction of your x-z movement to use and change in stead If forward is not correctly oriented, you will need to apply torque to reorient or Var lateralSpeed : float = Vector2(, ).magnitude

This means that you are not changing speed at all, but you could if you wanted. You could just set the velocity on the x-z plane to face the direction of your object. Set your velocity only on axes that don't affect gravity There are some solutions that come to mind immediately.
