Objects parented to camera stretch when rotating

I’ve been trying to make a simple fps with nodes, and for some reason the gun parented to the camera stretches when the camera rotates. Does anyone know what might cause this?

Edit: In case anyone else had this problem, you have to apply transformations to all objects (ctrl+A) or objects will stretch.