- Home /
Snap the rotation
rotX = Input.GetAxis("Mouse X") * speed * Mathf.Deg2Rad;
rotY = Input.GetAxis("Mouse Y") * speed * Mathf.Deg2Rad;
I can rotate my object like this, however how can I snap the rotation to values like 45, 90, 135, 180 etc.?
Comment
Your answer
Follow this Question
Related Questions
Clamp rotation of sprite? 0 Answers
Get object rotation for x axis in degrees (360) 1 Answer
Constrain object rotation set by mouse? 1 Answer
My Obstacle Rotations Are Not Correct 0 Answers
Limit Object Angle 2 Answers