So I have a turrent on a swivel created in blender that I would like to have rotating back and forth in a preview screen so I got this so far
public float speed = 1.5f;
private GameObject turrent;
private Quaternion localRotation;
private float maxVal = 140f;
private float minVal = 55f;
private void Start(){
turrent = GameObject.FindGameObjectWithTag ("Player");
}
private void Update(){
localRotation.y = Mathf.Clamp (speed, minVal, maxVal);
turrent.transform.rotation = localRotation;
}
I thought this would make it go back and forth between the 2 values but it just snaps to 140 degress in y
and doesn't go back and forth.
What am i doing wrong?