How to Rotate the ray cast where i want to throw projectile in 2d sidescroller?

Hello, I was thinking to use ray cast as aiming sight in my 2d sidescroller game but i have a question how will i rotate the ray cast in the X - direction (360 degrees) where i want to throw projectile, by using keyboard bindings. It will be a great help guys and thank you in advance.

line trace usually requires start and end points. start point can be your character origin, so use GetActorLocation function to get it. end point usually calculated by:

startpoint + direction*distance

direction is a normalized vector, distance is simple scalar.

so, using standard keybindings setup wasd or arrows, you can get axis events Right and Up, and make vector with its axis values. Right to X, Up to Z, and Y will be 0. use this vector as direction for line trace.