stuck on how to rotate objects back and forth looping.

I got a “leg” that I want to move back and forth on the x axis. all I get is errors so this is what I have been using but many need something else. Thanks.

publicfloatmin=2f;
publicfloatmax=3f;

//Usethisforinitialization
voidStart () {
min=transform.rotation.x;
max=transform.rotation.x+3;
}

//Updateiscalledonceperframe
voidUpdate () {

transform.rotation =newVector3(Mathf.PingPong(Time.time*2,max-min)+min, transform.Rotate.x);
}
}

Hi there, this is a documentation forum, I would recommend posting this in another portion of the forum, if you want to get a better answer.

Can you tell us which errors you are getting?