How do i create a BP function to find the intersection point of a ray and a plane?
Inputs: RayOrigin, RayDestination, PlaneOrigin, PlaneNormal - Returns True/False and a Vector (Point in the Plane) - Inputs via BP
Returns: True or False if not in plane. A output intersection point (Vector)
For a click to walk in direction camera controller style (Diablo like)
In the input above, what i will do is:
RayOrigin: Projected Mouse Cursor Screen to World Space
RayDestination: WorldLocation + (WorldDirection * 1000)
PlaneOrigin: Pawn Position
PlaneNormal: Z Vector for a TopDown Game (0,0,1)
Can that be rewritten in C++ code please?
Oh, I did it by myself. Check the answer here: Set collision settings for Brushes - Programming & Scripting - Epic Developer Community Forums
Probably the formula is a bit different, I have no “range” - it just works for every range.
This really helped me out! !
In case anyone wants to use the built in functionality, there’s a Line / Plane intersection blueprint node in UE4 now:
Ray Plane Intersection in C++
Line Plane Intersection Blueprint Node