Of course, I’ve not seen the code, but just a guess… are you using transform.rotation to set the elevation of the gun? If so, you probably need to use transform.localRotation instead.
I made a cylinder in 3ds max with it’s origin at one end of the cylinder instead of using the unity3d primitive cylinder whose origin was the center of the primitive. Now, when it rotates, it pivots on one end, rather than the center.
Alternatively, I suppose you could also parent the cylinder of the barrel to another object (a cube, say, placed where you want the pivot to be), and rotate the parent?
However I’d say making your own meshes is generally a better method of doing things anyway.
I did that with making a cannon turret and it worked fine. A sphere with multiple cylinders that recoiled when they fired and moved when the sphere was rotated.
All using Unity primitives.
I keep trying to add the file as an attachment here but I get a “no post mode error” every time.
I’ll host the file somewhere and then link to it.
Should be another day or so.