How do I rotate an object in the direction its moving (x axis)

I have an object in the scene and it can move left or right. I would like the object to slowly turn in the direction its moving across the x axis. How can I get it to do this?

use Vector3.RotateTowards. You can setup points around the player and specify what points to rotate towards (easy way). Another way you can control the rotation is to use “Transform.localEulerAngles” and specify what the rotation angle should be when Input is detected.