Download

Player Movement Speed

Hey folks,

I’m setting up my player movement animations at the moment and I’m using a blend space to blend between Idle (0.0f), walking (0.4f) and running (1.0f).

So to drive this I’m getting the length of the players movement vector, which of course is somewhere between 0.0f and 600.0f.

I’m just wondering if there’s a standard way of converting movement vector length to the (0.0f, 1.0f) range… or should I just divide the length by the current max movement speed from the character movement component?

I could modify my blend space so that the range matches the min/max movement speed of my player character, but the project is in it’s infancy and the fewer hard coded dependencies I have the better :slight_smile:

Thanks for your help!

Just divide in order to get a value from 0 to 1.

OK, thanks for the help!

Same result, different way: use the map range function which lets you remap any input range to any output range. So you could get the velocity vector value, and define min/max input/output boundaries. That will then output you a linear remapped value.