public void SwapCamera() { fpsCamera.gameObject.SetActive(!fpsCamera.gameObject.activeSelf); tpsCamera.gameObject.SetActive(!tpsCamera.gameObject.activeSelf); FirstPersonCamera fpsCam = fpsCamera.GetComponent <FirstPersonCamera>(); ThirdPersonCamera tpsCam = tpsCamera.GetComponent <ThirdPersonCamera>(); isFPSCamera = fpsCamera.gameObject.activeSelf; if (!isFPSCamera) { tpsCam.SetMouseXY(fpsCam.mouseLook); } else { fpsCam.mouseLook = tpsCam.GetMouseXY(); } currCamera = Camera.main; }