Rocket splash Damage

I’m generally wondering how would I go about making splash damage

I have a script here that calculates splash damage:
private void RayCastShoot()
Ray ray = cam.ScreenPointToRay(new Vector2(Screen.width / 2, Screen.height / 2));

        if (Physics.Raycast(ray, out hitInfo))
                var tempexpEffect = Instantiate(explosionEffect, hitInfo.point, Quaternion.LookRotation(hitInfo.normal));
                Destroy(tempexpEffect, 1);


                proximity = (hitInfo.point - hitInfo.collider.transform.position).magnitude;
                Splashdamage = CritHitDamage - (proximity / splashRadius);



But that composes a problem I only want it to calculate the damage if the radius hits the “Player tag” I tried adding if collider is == player etc… and it only calculates it if i actually hit the player

How about using OverlapSphere?