2D Top Down FlashLight RayCast Help.

Hi guys, im new here and iam trying to make a flashlight cone in a top down 2D game, but I want it to stop in the walls. I read that RayCast can help me but i did not find any tutorials, how can i use RayCast in the flashlight ? Thank You.

Hi @bruninDx,

Is there a reason you don’t want to use an actual spotlight? as that would solve all your issues. See image.
64558-lightexample.png

If you want to use a fake light then I’d give this tutorial a spin, it is very easy to follow and you get to learn a fair amount about RayCasting.