# Can I limit the rotation of an Object on an axis between a Negative and Positive value?

 0 Hellow, As asked in the title, is there a way to limit the rotation of an object between a negative and positive value? Exemple: Limit rotation from -90 (270) to 90. Thus making it from 270 to 0 to 90. And not 270 to 0 to 90. Thank you. more ▼ asked Oct 17 '10 at 06:43 PM Oninji 332 ● 43 ● 47 ● 50 add new comment (comments are locked) 10|3000 characters needed characters left ▼ Viewable by all users

 0 I control my rotation through a value. Convert the value to eulerangle. This permit to limit between a negative and positive value. It also avoid the gimbleLock problem. more ▼ answered Oct 21 '10 at 09:11 PM Oninji 332 ● 43 ● 47 ● 50 add new comment (comments are locked) 10|3000 characters needed characters left ▼ Viewable by all users
 0 You can use a hinge joint limit or you can use Vector3.angle For hinge joint you can set a min angle of -90 and a max angle of 90 but it's physics based so wont work for scripted movement. Finding the angle between a standard direction and the current direction via scripts and stopping its movement or snapping to the limit is the other option. more ▼ answered Oct 17 '10 at 09:33 PM spinaljack 9.1k ● 18 ● 31 ● 91 add new comment (comments are locked) 10|3000 characters needed characters left ▼ Viewable by all users

By Email:

Topics:

x5086
x2168
x2090
x322

asked: Oct 17 '10 at 06:43 PM

Seen: 2094 times

Last Updated: Oct 17 '10 at 06:43 PM