Answer the question
In order to leave comments, you need to log in
Rotate object y-axis by 90 and -90?
The question is probably stupid. There is an object, it must rotate to the right by n degrees, then to the left.
float r = 90f;
float l = -90f;
float angle;
transform.Rotate(0, angle * Time.deltaTime, 0);
Answer the question
In order to leave comments, you need to log in
int dur = 1;
//...
if (angle > 90) {
dur = -dur;
}
float r = 90f;
float l = -90f;
float angle;
transform.Rotate(0, angle * Time.deltaTime * dur, 0);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question