- Home /
how to rotate gameobject only in multiple of 36 degree ?
Hello everyone,
I have one 3d model with 10 poly and i want to rotate it only with multiple of 36 degree. User able to use mouse to rotate object but after user release mouse the object's rotate should be in multiple of 36 degree. Let say after user draginig mouse the new rotation angle is 60 but object rotate to only 72 degree , if user new rotateion angle is 95 then new rotation angle shoul ne 108 degree.
Thanks Yashesh.
Answer by Shadowys · May 26, 2014 at 11:12 AM
I am pretty sure Mathf can give you that. Something like:
#Boo
userinput=60
angle=Mathf.Ceil(userinput/36)*36
print(angle)
Your answer
Follow this Question
Related Questions
Simulate rotation using two force thrusters 1 Answer
How to get angular difference? 2 Answers
Camera rotation the same as player rotation 1 Answer
Limit gameobject rotation to -480 and 480 degrees? 2 Answers
Issue with an object rotating strangely 2 Answers