set rotation to velocity unity

C#
 transform.rotation = Quaternion.LookRotation(rigidbody.velocity);
Source

Also in C#: