ToggleKeyProblem

I’m trying to make a toggle script but I get this error “Only assignment, call, increment, decrement, and new object expressions can be used as a statement” can u help me, this is my script\

  1. using UnityEngine;
  2. using System.Collections;
  3. public class Steel_Sight : MonoBehaviour {
  4. private bool sight;
  5. public Transform SteelSightPoint;
  6. public Transform GunPoint;
  7. void Update ()
  8. {
  9. if (Input.GetKeyUp (KeyCode.Mouse1) && sight == false) {
  10. this.transform.position = SteelSightPoint.transform.position;
  11. sight == true;
  12. }
  13. if (Input.GetKeyDown (KeyCode.Mouse1) && sight == true) {
  14. this.transform.position = GunPoint.transform.position;
  15. sight == false;
  16.     }
    
  17. }
    
  18. }

use this

private bool sight;
public Transform SteelSightPoint;
public Transform GunPoint;
public float t = 5f;

void Update()
{
   if(Input.GetButton("Fire1")) //its better to use input rather than keycode
   {
      sight = !sight;
   }

    if(sight)
    {
        transform.position = SteelSightPoint.position;

        //alternate with lerp
        transform.position = Mathf.Lerp(transform.position, SteelSightPoint.position, Time.deltaTime * t);
    }
    else
    {
        transform.position = GunPoint.position;
        transform.position = Mathf.Lerp(transform.position, GunPoint.position, Time.deltaTime * t);
    }
}