- Home /
rotate an object on the z axis so that it does not exceed 0-45 degrees
When I click on the screen, I want to rotate an object on the z axis in the "Vector3.forward" or "Vector3.down" direction. Every time I click on the screen, "Vector3.forward" or "Vector3.down" will be randomly selected. The angle will also be determined randomly. However, the object will not exceed 0 and 45 degrees on the z axis. For example, the object is 10 degrees on the z axis when I first click on the screen, 32 degrees, when I click on the screen, 14 degrees, when I click on the screen I will return to 36 degrees. however, the object will not be lower than 45 degrees or below 0 degrees.
Your answer
Follow this Question
Related Questions
Quarternion Rotation 1 Answer
How can I clamp the object up and down rotation from 0 to -90? 1 Answer
Get my head around Unity Rotations 1 Answer
2D look at 1 Answer