Line Trace from a 3d point to mouse location

You’re tracing with a fixed distance of 500, replacing the projection’s X with a fixed value. It’s actually hard to imagine how that would look like, a strangely distorted / twisted undulating surface mayhaps? :cool:, for sure.


I want this trace to stay on the same plane as my character, so the X value of the start point & end point should be the same.

Consider the following:

:green_circle: create a virtual plane where the character is and point it towards X (Plane Normal 1,0,0)
:large_blue_circle: project 2d mouse location into the world from the camera, hitting that plane (Intersection)
:red_circle: trace from the character’s head towards that Intersection point

The result for the above.

The line in the anim above should be red…

That’s what I got from the description and intent. Do tell if it’s getting close.

maybe use get hit result under cursor…

Wouldn’t work if there was nothing under the cursor. And you’d need to play with channels to filter stuff out. Could work well in some scenarios, though - depends on how the world is constructed and how we’re interacting with it, ofc.

7 Likes