I’m just trying to get an object to rock back and forth but when I put in this code it stops moving after about a half second.
function Start () {
}
public var Amplitude =5.0;
private var RotSpeed:double;
function Update () {
RotSpeed = Mathf.Sin(Mathf.Deg2Rad*Time.time/2)*Amplitude;
transform.rotation.x=RotSpeed;
}
Can anyone tell me what’s happening?