I have very simple camera movement script:
public class playerCam : MonoBehaviour
{
public float sensX;
public float sensY;
public Transform orientation;
public Transform camHolder;
public float xRotation;
public float yRotation;
private void Start()
{
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
}
private void Update()
{
// get mouse input
float mouseX = Input.GetAxisRaw("Mouse X") * Time.fixedDeltaTime * sensX;
float mouseY = Input.GetAxisRaw("Mouse Y") * Time.fixedDeltaTime * sensY;
yRotation += mouseX;
xRotation -= mouseY;
xRotation = Mathf.Clamp(xRotation, -90f, 90f);
// rotate cam and orientation
transform.rotation = Quaternion.Euler(xRotation, yRotation, 0);
orientation.rotation = Quaternion.Euler(0, yRotation, 0);
}
}
and then in my movement script in void update, I have this line:
transform.rotation = Quaternion.Euler(0, Camera.eulerAngles.y, 0);
Camera rotates body perfectly, but while the body rotates, it also very slightly moves, causing this effect of camera popping in and out of body, essentially not standing in same place

I am struggling to figure out why