Debug.Log not showing in the console

I’m working on a RayCast weapon. My Debug.Log isn’t showing up in the Console.

using UnityEngine;

public class Gun : MonoBehaviour
{

    public float damage = 10f;
    public float range = 100f;
    public Camera fpsCam;


    // Start is called before the first frame update
    void Start()
    {


        if (Input.GetButtonDown("Fire1"))
        {
            Shoot();
        }
    }


    void Shoot()
    {
        RaycastHit hit;
        if (Physics.Raycast(fpsCam.transform.position, fpsCam.transform.forward, out hit, range))

        {
            Debug.Log(hit.transform.name);

        }


    }

}

Hi, if you want try this:

    // cast Ray from the center of the screen
    Ray rayOrigin = Camera.main.ScreenPointToRay(new Vector3 (Screen.width / 2, Screen.height / 2, 0));
    RaycastHit hit;
    
    if (Physics.Raycast(rayOrigin, out hit))
            {
                Debug.Log(hit);                   
            }

Don’t forget that your target needs to have collider or there will be no log message.