Help with AimDownSight

Hi there. I have problem with my Shot script. I can aim down sight but sometimes it’s glitchy.
Photo of normal aim down:

Now the “broken”. it happens sometimes but i want to stop it:

As you can se it doesn’t zoom… can somebody help me please?? Here is the script:

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class ShotScript : MonoBehaviour
{
    public Transform Kamera;// fpc camera
    public Transform metalHit;// texture of holes from bullets
    public Transform MetalSparks;// sparks from bullet
    public Transform MuzzleFlash;// fire shoot
    public Light Light;// light when shoot
    private RaycastHit Hit;// raycast ray
    public float RateOfSpeed = 0.5f;// rate of shoot
    private float _rateofSpeed;
    public int curAmmo = 0;// curent ammo
    public int maxAmmo = 12;// max ammo
    public int inventoryAmmo = 24;// ammo in inventory
    private float timeout = 0.2f;// timer
    public AudioClip Shoot;   // audio
    public AudioClip Reloaded;//
    public float Accuracy = 0.01f;//accuracy of bullets
    public GUIText bulletGUI;// text which shows the current ammo
    public int svumode;//animation mode
    private float svureload;
    public int damage;// robots damage
    public AnimationClip _Idle;    //
    public AnimationClip _Reload;  //
    public AnimationClip _Shoot;   // Animations
    public AnimationClip _AimOn;   //
    public AnimationClip _AimOff;  //
    public AnimationClip _AimShoot;//
    public AnimationClip _AimIdle; //
	public Text bulletText;
	public Text magazineText;
	string _idle_;
    string _reload_;
    string _shoot_;
    string _aimon_;
    string _aimoff_;
    string _aimshoot_;
    string _aimidle_;
    public bool aim;// can aim

    void start()
    {


    }
    void Update()
    {
		bulletText.text = "" + curAmmo.ToString ();
		magazineText.text = "" + inventoryAmmo.ToString ();
        _idle_ = _Idle.name;        //
        _reload_ = _Reload.name;    //
        _shoot_ = _Shoot.name;      // get name of animation
        _aimon_ = _AimOn.name;      //
        _aimidle_ = _AimIdle.name;  //
        _aimoff_ = _AimOff.name;    //
        _aimshoot_ = _AimShoot.name;//

        //start animation

        if (svumode == 0)
        {
            GetComponent<Animation>().CrossFade(_idle_);// idle animation
        }

        if (svumode == 1)
        {
            GetComponent<Animation>().Play(_aimon_);// aim on animation
            svumode = 3;// animation mode
        }
        if (svumode == 2)
        {
            GetComponent<Animation>().Play(_aimoff_);// aim off animation
            svumode = 0;// animation mode
        }
        if (svumode == 3)
        {
            GetComponent<Animation>().CrossFade(_aimidle_);// aim idle animation
        }
        //Reload
        if (svumode == 4)
        {

            GetComponent<Animation>().CrossFade(_reload_);// reload animation
            svureload += Time.deltaTime;
        }
        if (svureload >= GetComponent<Animation>()[_reload_].length)// if end animation
        {
            Reload();
            svumode = 0;// animation mode
            svureload = 0;
        }


        //end animation



        if (_rateofSpeed <= RateOfSpeed)//rate of shoot
        {
            _rateofSpeed += Time.deltaTime;
        }
        if (timeout < 0.1f)// light timer
        {
            timeout += Time.deltaTime;
            Light.range = 15;
        }
        else
        {
            Light.range = 0;
        }

		if (Input.GetMouseButtonDown(1) && aim == false & svumode == 0)// if aim on
        {
            svumode = 1;// animation mode
			Kamera.GetComponent<Camera>().fieldOfView = 30;// camera depth = 30
            aim = true;
			//Kamera.GetComponent<MouseLook> ().sensitivityX = 3;//sensitivity change
			//Kamera.GetComponent<MouseLook> ().sensitivityY = 3;//sensitivity change
			GameObject.FindWithTag ("Player").GetComponent<MouseLook>().sensitivityX=3;//sensitivity change
			Kamera.position = new Vector3(0.006f, -0.039f, 0.147f);
        }
        else
			if (Input.GetMouseButtonUp(1) && aim == true)
        {
				Kamera.GetComponent<Camera>().fieldOfView = 60;// camera depth = 60
				aim = false;
                svumode = 2;// animation mode
				Kamera.GetComponent<MouseLook> ().sensitivityX = 10;//sensitivity change
			    Kamera.GetComponent<MouseLook> ().sensitivityY = 10;//sensitivity change
			    GameObject.FindWithTag ("Player").GetComponent<MouseLook>().sensitivityX=15;//sensitivity change
			}
        

		if (Input.GetMouseButtonDown(0) & _rateofSpeed > RateOfSpeed & (svumode == 0 || svumode == 3) & curAmmo > 0)// if shoot
        {

            timeout = 0;
            GetComponent<AudioSource>().PlayOneShot(Shoot);// play audio
            if (aim == true)
            {

                GetComponent<Animation>().Play(_aimshoot_);// aim shoot animation
            }
            else
            {
                GetComponent<Animation>().Play(_shoot_);// shoot animation
            }
            Vector3 Direction = Kamera.TransformDirection(Vector3.forward + new Vector3(Random.Range(-Accuracy, Accuracy), Random.Range(-Accuracy, Accuracy), 0));//accuracy of bullet
            curAmmo -= 1;//ammo consumption
            _rateofSpeed = 0;
            MuzzleFlash.GetComponent<ParticleEmitter>().emit = true;

			if (Physics.Raycast(Kamera.position, Direction, out Hit, 10000f))// create raycast ray
            {

                if (Hit.collider.CompareTag("Robot"))//If ray hit robot
                {
					Hit.collider.GetComponent<Robot_Destroy>().Robot_health -= Hit.collider.GetComponent<Robot_Destroy>().gun_damage;// robot health - damage
                }
                Quaternion HitRotation = Quaternion.FromToRotation(Vector3.up, Hit.normal);// create bullet hole
                if (Hit.transform.GetComponent<Rigidbody>())// if ray hit rigidbody object
                {
                    Hit.transform.GetComponent<Rigidbody>().AddForceAtPosition(Direction * 800, Hit.point);// object push
                }
                if (Hit.collider.material.staticFriction == 0.2f)
                {
                    Transform metalhitGO = Instantiate(metalHit, Hit.point + (Hit.normal * 0.001f), HitRotation) as Transform;//
                    metalhitGO.transform.parent = Hit.transform;                                                              // create sparks
                    Instantiate(MetalSparks, Hit.point + (Hit.normal * 0.01f), HitRotation);                                  //
                }

            }
        }
        else
        {
            MuzzleFlash.GetComponent<ParticleEmitter>().emit = false;
        }
		if (Input.GetKeyDown(KeyCode.R) & inventoryAmmo > 0 & curAmmo != maxAmmo)// if reload
        {
			Kamera.GetComponent<Camera>().fieldOfView = 60;//
            aim = false;// aim off                      
            GetComponent<AudioSource>().PlayOneShot(Reloaded, 0.7f);// play audio
            svumode = 4;// animation mode
			Kamera.GetComponent<MouseLook> ().sensitivityX = 10;//sensitivity change
			Kamera.GetComponent<MouseLook> ().sensitivityY = 10;//sensitivity change
			GameObject.FindWithTag ("Player").GetComponent<MouseLook>().sensitivityX=15;//sensitivity change
        }
    }

    public void Reload()//ammo calculation
    {

        if (inventoryAmmo < maxAmmo - curAmmo)
        {

            curAmmo += inventoryAmmo;
            inventoryAmmo = 0;
        }
        else
        {
            inventoryAmmo -= maxAmmo - curAmmo;
            curAmmo += maxAmmo - curAmmo;
        }
    }
    void OnGUI()//draw current ammo
    {

        bulletGUI.text = "" + curAmmo + "/" + inventoryAmmo;
    }
}

And also i get this error but i don’t know what it is???!?!?!:
NullReferenceException: Object reference not set to an instance of an object
ShotScript.Update () (at Assets/FPS Starter Kit - Lite/Scripts/_Weapons/ShotScript.cs:122)

I don`t have much time to explain but any how implement this code in script

 public Vector3 defaultPosition;
    public Vector3 aimedPostion;
    public float aimSpeed;
    public float aimFOV;
bool isReloading;
public Camera cam;
void CheckAimDownSights()
    {
 
        if (Input.GetButton("Fire2") && !isReloading)
        {
            transform.localPosition = Vector3.Lerp(transform.localPosition, aimedPostion, Time.deltaTime * aimSpeed);
            weaponCamera.fieldOfView = Mathf.Lerp(cam.fieldOfView, aimFOV, Time.deltaTime * aimSpeed);
        }
        else
        {
            transform.localPosition = Vector3.Lerp(transform.localPosition, defaultPosition, Time.deltaTime * aimSpeed);
            cam.fieldOfView = Mathf.Lerp(weaponCamera.fieldOfView, 60, Time.deltaTime * aimSpeed);
        }
    }

You can adjust the setting later on. Thanks It will work definitely.

Script cant find player which should be tagged as “Player” or component which is attached to player as mouselook script or a value in this script like sensitivityX value.
I suggest you to use your own scripts rather than using game ready frameworks. You should check them to understand the logic but like in this case there are always some values missing like tags, references or layers.