C# script not working once I add a piece of code,When I use this line of code shooting does not work

I am making a survival game and in it, I have shooting and aiming, but when I put in a certain line of code
which is .

zoomCameraAnim = transform.Find(Tags.LOOK_ROOT).transform.Find(Tags.ZOOM_CAMERA).GetComponent<Animator>();
crosshair = GameObject.FindWithTag(Tags.CROSSHAIR);
mainCam = Camera.main;

neither the aiming nor shooting works.
Here is the rest of my code.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerAttack : MonoBehaviour
{
    private WeaponManager weapon_Manager;

    public float fireRate = 15f;
    private float nextTimeToFire;
    public float damage = 20f;

    private Animator zoomCameraAnim;
    private bool zoomed;

    private Camera mainCam;

    private GameObject crosshair;

    private bool is_Aiming;


    void Awake()
    {

        weapon_Manager = GetComponent<WeaponManager>();

        zoomCameraAnim = transform.Find(Tags.LOOK_ROOT)
            .transform.Find(Tags.ZOOM_CAMERA).GetComponent<Animator>();
         
        crosshair = GameObject.FindWithTag(Tags.CROSSHAIR);

        mainCam = Camera.main;
    }



    void Start()
    {
        
    }


    void Update()
    {
        weaponShoot();
        ZoomInAndOut();
    }

    void weaponShoot(){
        
        

        if (weapon_Manager.GetCurrentSellectedWeapon().fireType == WeaponFireType.MULTIPLE) {

            if (Input.GetMouseButton(0) && Time.time > nextTimeToFire)
            {
                nextTimeToFire = Time.time + 1f / fireRate;

                weapon_Manager.GetCurrentSellectedWeapon().ShootAnimation();
            }

        } else {

            if (Input.GetMouseButtonDown(0)) {
                if (weapon_Manager.GetCurrentSellectedWeapon().tag == Tags.AXE_TAG) {
                    weapon_Manager.GetCurrentSellectedWeapon().ShootAnimation();

                } if (weapon_Manager.GetCurrentSellectedWeapon().bulletType == WeaponBulletType.BULLET) {
                    weapon_Manager.GetCurrentSellectedWeapon().ShootAnimation();

                    //BulletFired();
                }
                else {

                 
                }
            }
        }
    }

    void ZoomInAndOut() {

        if (weapon_Manager.GetCurrentSellectedWeapon().weapon_Aim == WeaponAim.AIM) { 

            if (Input.GetMouseButtonDown(1)) {
                zoomCameraAnim.Play(AnimationTags.ZOOM_IN_ANIM);

                crosshair.SetActive(false);
            }

            if (Input.GetMouseButtonUp(1)) {
                zoomCameraAnim.Play(AnimationTags.ZOOM_OUT_ANIM);

                crosshair.SetActive(true);
            }

        }
        if (weapon_Manager.GetCurrentSellectedWeapon().weapon_Aim == WeaponAim.SELF_AIM) {

            if (Input.GetMouseButtonDown(1)) {
                weapon_Manager.GetCurrentSellectedWeapon().Aim(true);

                is_Aiming = true;

            }
            if (Input.GetMouseButtonUp(1))
            {
                weapon_Manager.GetCurrentSellectedWeapon().Aim(false);

                is_Aiming = false;

            }
        }



    }
}

Where do you have reference to theTags enum? E.g. Tags.LOOK_ROOT, also WeaponAim.SELF_AIM
and AnimationTags.ZOOM_IN_ANIM. I don’t see them in the code you pasted. If they aren’t referenced, this makes no sense.


Also, when you do crosshair.SetActive(false);, you are disabling the crosshair. To my knowledge, you can’t do GameObject.FindWithTag() on disabled gameobjects, and therefore, that might be why this line of code: crosshair = GameObject.FindWithTag(Tags.CROSSHAIR); stops working. @SpankedyHankDank