How can I decrease one value by increasing another?

Hey all!

I’m working in a footsteps system, and because it’s a bare first person with no animations, I’m using a delay node with a “step rate” float to determine the amount of time it has to pass between each step.

What I want to achieve is: the higher the player velocity is, the lower the step rate is. The default walk speed is 160, and the default step rate is 0.55; so, for example:

If the player velocity is 320, then the step rate would be 0.275.
If the player velocity is 80, then the step rate would be 1.2, and so on.

I sincerely haven’t tried anything, because my tiny brain can’t even comprehend how this could work. So, how could I setup the nodes to achieve the magic?

use a curve?
and set value time relation.
then when u put a velocity that will give u step rate what u want.

Here is my example of how to use curve value


Curve itself

Use a map node:

3 Likes

jesus christ it works :heart_eyes:

1 Like