is there a way to preventing 2D light from passing through sprites, if the light is behind vs front sprite ?

if you have a simple rock sprite in your 2d scene. and lets say, the player has a light source goes in front and behind this rock, even though you can’t see the player when they are behind the rock sprite, the light is still showing. is there a way to prevent this from happening in 2d scene?

you mean like cast a shadow?