Can I lock a raycast to an axis?

In a 3D Sidescroller template: I have a simple raycast from my character(Start) to mouse cursor(End). And then straight down to land on the ground to set the endpoint for future teleport. I need the End to move only on the axis that my pawn is on - to the sides, up and down. Can I lock/constrain my linetrace to an XY axis so it won’t fly behind and in front of the pawn? Sort of like restraining planar movement on pawns but for a cursor/linetrace?

Here you can see the lines out of the XY plane. I want to lock them onto the XY axis of the pawn so he could teleport in front of him or up/down, not to the sides. :

Here is what I have so far:

Any feedback is greatly appreciated!

OK, I’ve got it. The questions still stands, though, but I found a workabout for my teleportation problem.
I used a linetrace from the Get Hit Result Under Cursor and projected it to the X plane. I’ve placed a Blocking Volume behind the pawn and got the impact point of the linetrace. Then just shot another raycast straight down from there. That way, I always get a point on the blocking volume under the cursor and teleport to the point below on the ground.
I’ll post screenshots asap.