- Home /
Question by
Toooms · Feb 27 at 06:51 PM ·
euleranglesangleseulerclamped rotation
Clamping localrotation between two angles
So I'm trying to clamp the rotation of my turret between two values, that is the angles at which my boats left and right side are. Since these values are constantly changing, I've had some issues with Euler's not behaving. link to unlisted youtube video The turret moves independently from the boat, and the boat moves & rotates too. I want the cannon to be locked rotationally, so that it can't rotate past the left or right side of the ship whenever its rotated aswell. Here's the part of my script where I want to do it, if it helps, hope there's some other way to do this other than to mess around endlessly with eulers.
demonstration-code.png
(25.2 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613053553im_/https://answers.unity.com/themes/thub/images/avi.jpg)