Detection where light hits using SphereCast

Hi,
I have a spotlight that rotates around its X axis, sort of a Security light that the player has to avoid.

I’m trying to detect when the player touches the light using physics.SphereCast, but it’s a trouble maker-
I can’t seem to get the exact radius to fit perfectly in the light, it either detects the player a few dozen pixels before it reaches him, or it doesn’t detect him at all…

this is the script I attached to the rotating light :

public class LightPatrol : MonoBehaviour {

    void Update() {
		RaycastHit hit=new RaycastHit();

	 if (Physics.SphereCast(transform.position, 4.0f, transform.forward,out hit,  1))
		{
			if(hit.collider.gameObject.tag == "Player")	{
			animation.Stop("LightFlip");
			}
		}
			
    }

}

Is there a better way of doing this?

Every frame compare the angle of the light to the player. If the delta is within the spot light’s angle, he’s within the light code (not taking into account obstructions of course). To deal with obstructions, first do this check and then do a sphere or ray cast to check if the player is hiding behind something.