So I’ve got this wallrun setup, and it works well enough, except I can’t seem to get the “Jumping Off” bit to work. Ideally, when I press the space bar, it should automatically jump up and away from the wall. But unfortunately I can’t seem to get the “Away” bit and my guy just ends up lurching up the wall unless I’m expressly holding the movement key away from it.
I am assuming this is a problem with my vector math, as I have a hard time wrapping my head around the subject. I am assuming the end goal is a vector like this green one here with an arbitrary Z value:
I also tried using a reflect vector, mirror vector by normal and a Dot Product based method but I don’t know how to math out the latter (I’ve watched a lot of tutorials but just can’t get it through my skull here) and I think the former isn’t working because my forward vector and the wall’s normal vector are perpendicular?
Exactly! To achieve your goal, you can simply get the actor right vector (or wall normal), multiply it by something like 100 and plug it’s X and Y axes into the corresponding pins of the Launch Character node. No need for cross product here
Btw you don’t need to normalize the cross product since it’s already a unit vector, because your two input vectors are unit vectors. We’re not gonna be using it here but wanned to add this as well.
In your BP you re using Launch with 1000 on the Z axis but both X and Y are normalized (in the range 0-1) which means that your horizontal component is non-existent. (even if it was correct)
The cross product always returns a vector perpendicular to both inputs which means that WallrunNormal x Forward will always point up.
P.S.
You might remove the unneeded components (like the forward boost) and maybe combine the parameters in a single vector instead of having them separated but it was easier to explain that way.
I was about to post how this didn’t solve the issue, only to then realize that I had never actually set the “wallrun normal” variable to equal the plane normal I was sending to the state component in the first place. Fixing that blunder made this solution work perfectly. Thank you so much for your help!