How can I make areas that are not directly visible to the player greyed out/pitch black

Hello, I am planning on doing a project-zomboid like camera system where the areas that are not visible to the player character’s eyes are just greyed out and the areas behind walls etc. are pitch black, I am thinking of using raycasting to check what the player character can see but I have no idea how to make the areas not visible just pitch black/greyed out

I think my explanation sucks so here’s an example: https://youtu.be/mYKdNgM3gV0?t=117
It’s not the best but It should work

You could use Atmosphere to make a kind of fog.

But how can I manipulate the fog to be where I need It to be only though

You could modify the properties using a local script, and to detect the players being in certain areas you could use game.Workspace:GetPartBoundsInBox(), game.Workspace:GetPartBoundsInRadius() or game.Workspace:GetPartsInPart(), you could also use Region3 and Magnitude

Oh alright, thanks man, I’ll check that out