system
1
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.
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.
system
3
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.