Hi,i’d like to rotate an object by 90 degrees over a small amount of time so it would create a nice rotation effect.
For example,if i click on the right side of the screen the object would rotate by -90 degrees with a visible rotating effect,because if i simply write: transform.Rotate(0, 0, -90); then it snaps to the new rotation.
void Update() { if (Input.GetMouseButtonDown(0) && Input.mousePosition.x > Screen.width / 2) { //rotate by -90 degrees } else if(Input.GetMouseButtonDown(0) && Input.mousePosition.x < Screen.width / 2) { //rotate by +90 degrees } } Thanks in advance.
Thanks,but i want it to roll,i forgot to add that,so i would like it to rotate around the z axis.
I dont really get quaternions just yet,but it might be the answer.