So I want to rotate it smoothly around the x-axis. When the X-velocity is positive, I want the rotation to be zero, and when it is negative, 180 degrees. I got this far below, but I’m not sure how to finish it.
public var rotationSpeed:float = 5;
public var targetAngle:float = 0;
public var mod:Transform;
function Update () {
var rig:Rigidbody = this.rigidbody;
if(rig.velocity.x > 0){
targetAngle = 0;
}else{
targetAngle = 180;
}