Rotation/position question.

So I am making a script to stick my gun to the players screen, however, for some reason there is a delay when I look around (like in battlefield 3/planetside 2). I don’t want this to happen and it is causing my gun to jitter. I can’t figure out what is wrong. This script runs in the gun.

    transform.position = cameraObject.transform.position;
	rotationTarget = cameraObject.transform.rotation;
	transform.rotation = rotationTarget;

Do either:

Make the gun a child of the camera (as suggested above)

If your movement is done in physics and/or FixedUpdate(), then gun placement should as well.

Check your script order execution. Consider gun placement in LateUpdate() instead of Update()