It's by design that a child inherits its parent's position, rotation, etc. That way a gun (child) can be pointed independently, but it will also change its direction if the player (parent) turns. The alternative would be to make them siblings in a parent container, where they could both work independently, but would both move/rotate with the container.
Regarding your specific problem with the "snap back and forth" when changing the rotation of your gun, you may be using degrees when your statement is expecting radians. Are you using set_global_rotd
or set_global_rot
?
Also, make sure you aren't confusing rotate
(changes the rotation relative to the current rotation) with set_rot
/ set_rotd
(sets the global rotation).