Download

Wallrunning at a fixed speed?

Hey. I’m working on a fps and I’d like for my character to wallrun at a fixed speed. Right now it runs faster when you look parallel to the wall and increasingly slower the more you look towards the wall. This is what I’ve got so far.

The part I think I need to edit to obtain the solution:

“Find Run Direction And Side” Function

I don’t see anything here that is affected by the look direction. Perhaps the problems is in the math between the input rotation, WallRunDirection and add movement function?

Did some quick test and managed to get the “problem” of slowing down with camera rotation and it’s also an easy fix, but my approach is different thatn yours:

With angle influence redirected parallel to surface:
WallRunnAngleInfluence

Constant velocity redirected parallel to surface:
WallRunnConstantVelocity

It works:

… that’s not redirected “parallel”… it’s redirected with the impact normal isn’t it?

Your function could probably just calculate the dot internally no?

Everyone’s a critic, I know :stuck_out_tongue:

It gets a projected vector thats orthogonal to the normal vector… that happens to be parallel to the surface / polygon it hit. :sweat_smile:
WallRunnDebugNotNormalized

Normalized:
WallRunnDebug

This above is what I think @Nakhhhh problem is, but I don’t see that in what he shared. His result of the cross product (WallRunDirection) should already be a unit vector.

Of course. Just that sometimes I think it could leave some implicit details and prefer a few extra (or all) nodes when sharing ideas with strangers.

image

1 Like