How to get rotation of constrained object? So let's imagine I have a gun pointing at a target. Gun has copy location constraint to locate to another object that rotates around the same axis as the gun. Gun has track to constraint to keep it pointing towards the target (just up/down movement, rotation around its y axis which is x axis in world space). On it's 0-position there is an initial angle of about 10 degrees of up (measured by hand).
How do you actually get the gun rotation so I can set its allowed range to -55 to +55 deg? How do I even get the gun rotation value at all? The gun object rotation in the n.menu transform panel is 0 and never changes no matter how I move the target. I've tried using limit rotation constraint but it is totally broken and just set's the object rotation to its max value
Here is a sample file:
http://www.mediafire.com/file/c4x62lx6kmil7nu/constraints.zip/file
The rotation of the rectangle object causes the &quot;gun&quot; to go outside of its rotation limits. The cylinder should point towards the target as long as its angle is inside its local rotation limits. These rotation limits come from the rectangle object.
In other words the angle limit is for the angle between the rectangle and the cylinder. Cylinder moves with the rectangle (rectangle just rotates) and cylinder points at the target as long as its angles are inside its limits.
The file you've linked works as it is supposed to work, you've given a Limit Rotation on the X axis of -30° and 30°, as seen below. 0° on the X axis is a flat axis (in Global axis but also in cylinder's Local axis if you ever switch to it).

If you want the gun to follow the angle you're displaying you need to choose Min -60° and Max 0°.

If you want the angle to be relative to the rectangle rotations, don't use a Copy Location for your cylinder, parent it to the rectangle so that it's new Global orientations depends on the rectangle, not on the world. Also don't forget to limit on Z so that it doesn't flip.