Can someone help me how to pause a rotating object every time it reach half of the whole rotation?
I have this code but I can only get the 1st half
if(!pause){
transform.Rotate(new Vector3(0,0,-1)* rotationspeed * Time.deltaTime);
pauseAngle = transform.rotation.eulerAngles.z;
}
if(pauseAngle <= 180 && timerPause > 0 ){
timerPause -= Time.deltaTime;
pause = true;
}
if(timerPause <= 0){
timerPause = 2;
pause = false;
}
Anyone?