how to make raycast hit all objects in a line

laser.SetActive(true);
        StartCoroutine(Laser());
        AmmoBox.currentAmmoLaser = AmmoBox.currentAmmoLaser - 70f;
        recoil.Fire();
        RaycastHit hit;
        if (Physics.Raycast(fpsCam.transform.position, fpsCam.transform.forward, out hit, range))
        {
            Debug.Log(hit.transform.name);
           
            Target target = hit.transform.GetComponent<Target>();
            if (target != null)
            {
                    target.TakeDamage(damageLaser);
                    Debug.Log(damageLaser);
            }
           
            if (hit.rigidbody != null)
            {
                hit.rigidbody.AddForce(-hit.normal * impactForce);
            }
           
            GameObject impactGO = Instantiate(impactEffect, hit.point, Quaternion.LookRotation(hit.normal));
            Destroy(impactGO, 3f);

This only hits the first object it collides with

Unity - Scripting API: Physics.RaycastAll ?

yes, that’s it, works well, thanks!

Just remember that:

yeah I saw that too, doesn’t matter in my project