I am currently trying to build a wall climbing system and need to be able to snap the player to a point closest to them on the wall. I know the dimensions and world location of the wall, and the player location, but I am unsure of how to find the point where there is a minimum distance between the surface of the wall mesh and the player world location.
From there I would be able to lerp the player world location to this new location.
Does anyone have any idea on how to go about finding this new location?
Move the player to the wall directly using a swept move.
Also, assuming your wall is a plane, you can use Project Point on to Plane (or something like that) to get the shortest path to the wall. (The plane is your wall and the point is your player’s location)
Thanks a lot! This sounds like it will be useful. Currently my plane is made up from a cube with the scale on one of the axes set to 0. Would this work or is there a specific plane component that I need to use?
EDIT:
Incase anyone ever stumbles across this;
There is no specific plane component to be used. The “project point on to plane” node uses an infinite mathematical plane which the point (player’s world location) will be projected onto. The location of this plane in 3D space is calculated using a point that you want to be on the plane and the normal vector for that plane. I calculated my normal vector by using the “get unit direction vector” node - using the world location of two arrrow components as inputs.
Lots of information on understanding how vectors, planes and normal vectors work can be found online, i.e. wikipedia and youtube.