- Home /
Make object only rotate in 90 degree increments
I have it so that once this object spawns, it looks at the player using only the Y axis. It works, but I want to make it so that the object ONLY uses 90 degree increments when looking at the player. So for instance, if looking at the player makes its angle 70 degrees, then it instead goes to 90 degrees, and if looking at the player makes its angle 187 degrees, then it instead goes to 180 degrees.
Here is my code so far.....
Your answer
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
Mathf.MoveTowardsAngle is not working as predicted 1 Answer
My marble (Player/Gameobject) goes through the "play board" (gameobject). Why? 1 Answer
How to keep a Gameobject in the same position after a transform.Rotate? 2 Answers
Object position to player position in angle and apply to rotating a gui plane? 0 Answers