Restricted view for my horror game(Solved!)

I need a lighting mechanic so that the player cant see parts of the world that they shouldn’t. But the example i used didn’t work for my 2-d game.They used 2.5 view.I found out that 2-d and 2.5 code don’t work with each other, can someone help make one for 2-d please?


Game link:

Use this example instead.

Thanks! This helped a lot! :grinning::