Need help with an aim script

i’ve made a script that moves the camera to an emty game object but it only activate one time, it only switch the camera to default location or"cameraNormal" in script.

  public bool inAim = false;
  public GameObject other;
  GameObject cameraNormal;
  GameObject cameraAim;
  Camera mainCamera;

void Start(){
        cameraNormal = GameObject.Find("camera1");
        cameraAim = GameObject.Find("camera2");
        mainCamera = Camera.main;
}
void FixedUpdate(){

if (inAim == true&& Input.GetMouseButtonDown(1))
        {
            mainCamera.transform.position = cameraNormal.transform.position;
            inAim = false;
            Debug.Log("goes to default cam");
        }
        else if (Input.GetMouseButtonDown(1) && inAim == false)
        {
      
      
            mainCamera.transform.position = cameraAim.transform.position;
            inAim = true;
            Debug.Log("goes to aim");
         }
}

Nevermind i found it! :smile:

It seems there is a problem with the inAim boolean.

The condition on line 15 and 21 are the same.

Also, inAim is set to false at line 18, which has no effect since inAim must be false in order to reach that line.