I have a gun model made up of multiple parts, attached to a rotating transform. Parts are transforming separately. (Images)

So first and foremost, the images, I feel like they accurately describe the issue.

Higher vertical rotation
Starting vertical rotation

The current hierarchy order: Head → Gun → GunParts

So I’m wondering if there is a way to fix this without making the model into a single part. I would much rather keep all the parts as separate children.

transform.localRotation=Quaternion.Lerp(transform.localRotation,Quaternion.Euler(ytargetRotation,xtargetRotation,0),Time.deltaTime*10/smoothing);

Global rotation makes no difference to the issue.

Do all the gun parts have a single transform as a parent?

Also which transform are you rotating?

Just add the parts to an empty gameObject. You can still modify them separately if you need to. At least if that is what you mean by, “I would much rather keep all the parts as separate children”.

I don’t think you should be using local rotation; just use rotation and you only need to apply the rotation to the root object.

Are you by chance using a scale other than (1,1,1) in any of the object’s in your hierarchy? You can achieve this type of thing by using a non-uniform scale on a parent and rotating anything below it.