Finding location under cursor (without hit) for top down dash ability

As the title states, I’m trying to find the location under the user’s cursor to create a rotation direction before activating a dodge. I’m attempting to implement this without requiring a click/hit, aside from the user pressing the space bar. Wherever the cursor is, the actor should roll in that direction.

I have a DetermineCursorLocation function that returns a vertex, although I’m not certain of its accuracy, just that it’s returning a vertex. That vertex is then broadcast using the gameplay message subsystem, because I’m trying to avoid casting (although it might be fine in this instance as the player will always have this ability). On the ability, I listen for the broadcast vertex, feed it into a find look at rotation, then set actor rotation.

What I’m seeing is poor directional accuracy. For example, the actor doesn’t always roll exactly toward the mouse. Can anyone tell from these blueprints where I’m going wrong?

Appreciate the help!

your target is wrong try this instead :eyes:
PD: u can copy paste the nodes into unreal :shushing_face:

https://dev.epicgames.com/community/snippets/zKg2/unreal-engine-look-at-mouse-position-top-down

you can skip the distance calculation, just use a large number instead. I only used distance because it’s the minimum range needed for the line when the camera and player planes are parallel. And the multiplier should be the hypotenuse of the angle between the two planes, but like I said, you can skip all that math as long as the line is long enough.

You could try using the LinePlaneIntersection node to essentially trace to an imaginary plane. I use that in my 2.5D side project to get mouse location along the plane player is constrained to when holding right mouse. Event in my 2.5 D player char looks like this:

For top down, change the plane normal to 0, 0, 1 to make a virtual horizontal plane with player loc as the center. Then you could even dash when falling if need be where there’s no ground for normal trace to hit. World dir coming from mouse loc node may be weird if camera is angled like Diablo or something tho. In my case camera is perpendicular to the movement and virtual planes.