Help with LookAT() problem Needed.

ok the issues is i have a twin cannon and i have it compensating the angle for range i have constrained the movement to avoid model clipping etc. and its working fine but it keeps shooting even when the constrain wont let it point at the target.

i wanted to compare the current rotation of the muzzle position(fixed where bullet spawns) to the LookAt() rotation for the muzzle position without moving the muzzlepossition and if they match fire a bullet. Problem is i cant seem to figure out how

Any Help Would Be Appreciated.

Ps. Preferably c# code but i can convert js if needed.

Use Quaternion.Angle to get the angle between the two rotations.