I Need to stop light from continue after a certain point

Hello !

Iam making a 2D game, but using Perspective camera to get lights.
But, i have one trouble…

I need to stop the light from continue after the ground:

This is just an idea (I have no clue if it will work) but you could put a small ledge facing out toward the camera so the camera can’t see it, and the ledge will block the light. Also, I don’t know what kind of game you are making, but it might be cool if the light can shine through the ground. Just a thought.