Twin stick 2D shooter (Line trace)


So basically I want to make a sidescrolling game with a 2D camera (think along the lines of the basic side scroller template in UE4) but you can aim and shoot in 360 degrees with the right analog stick (so not towards or from the camera).

I think the easiest way to sort of get this going is just to get a line trace that can go in 360 degrees in a 2D plane, but how would I go about doing that?

Thanks in advance!

Ok so I figured it out for anyone that’s curious (see image).
I haven’t cleaned it up, but you get the idea.