Wall Run Wall Climb Discernment

Hello, I’m currently working on a wall run and it’s almost finished, it just needs one minor thing that I don’t know how to do. Essentially, I have a wall climb and a wall run that my character can perform but what I want is for the character blueprint to be able to discern automatically whether the character should be wall running or wall climbing based on the angle they approach the wall at. Currently, I have edits to have the wall climb play at certain inputs but I’d like this to be automatic similar to how the 3D Ninja Gaiden games do this. Any help would be appreciated.

You can get the direction from the character to the wall and get a dot product of this direction and character right vector. If the absolute value of the dot product is more than 0.7071, the wall is t o the side of the character; if less, then the wall is in front or behind the character. But dot product with the char forward vector can sort that out.

P.S. The direction to the wall must be calculated to the nearest point, not to wall actor location. You can use [GetClosestPointOnCollision] node for that;

1 Like