Answers for "Help with rotation."
http://answers.unity.com/questions/1325280/help-with-rotation-1.html
The latest answers for the question "Help with rotation."Answer by ExtinctSpecie
http://answers.unity.com/answers/1326686/view.html
so i tried this out and as i understood the rotation function functions like a sine function with a 4*pi period time and a peak of 1
so the values move from 0 -> 1 , 1 - > 0 , 0 -> -1 , -1 - > 0 and then the same again
in your case you want to stop at about 0.5 which is about 60 degrees
float zAx = 0;
// Update is called once per frame
void Update ()
{
zAx = -10 * Time.deltaTime;
if (transform.rotation.z > -0.5f && transform.rotation.z < 0.5f)
{
//continue rotating
transform.Rotate(0f, 0f, zAx);
}
else
{
//will stop rotate
}
}
i apologize for my englishThu, 16 Mar 2017 08:16:27 GMTExtinctSpecie