get the rotation of a 3d object in unity code example Example: set rotation to velocity unity transform.rotation = Quaternion.LookRotation(rigidbody.velocity);