How can I get the relative velocity or direction of a player?

Hi I was just working on a dash and came across a similar problem. Here is a blueprint I’m using that I got to work pretty well. It’s not perfect, but it’s pretty good.

Basically it checks if the character is walking, and not dashing, then sets a bunch of stuff, like no gravity, no friction, no braking so it will move uninterrupted in that direction. It then sets the dash vector based on the last player input. This is what you want since it bases the direction on player input, not velocity. Then it sets velocity, cause I have a short animation of the player getting into a dash stance, sets rotation rate to zero so the player can’t rotate after the dash has started and make it look wonky. Then it sets the player to rotation to the direction of the dash. That delay is just the time of the warm up animation, then he dashes. After that there is just a delay (how long the player dashes), and all the things I set at the start are reset to their defaults. I also set the velocity to 0 again. This way if you dash off a cliff, then dash will end and the player will fall straight down, rather then carrying on the momentum.
Hope this helps

1 Like