I need help to emulate McCree's roll or hanzo's leap movement

As the title states i’m struggling in putting together a code that will allow the player to move in a manner that would mimic said abilities without requiring the player to look towards the direction of the leap (pretty much by letting the translation of the player through the use of the WASD keys determine where the impulse will be applied) i’ve tried to have a loop constantly storing and updating the player position in order to determine the translation through the use of vectors but the code ended up being very unpredictable (but that might’ve also been my fault as the process is rather confusing so code might’ve been not working to begin with) so i’m kinda lost at this point.
Is there someone capable of lending me a hand and sort something out?

Try this: WWR28, for McCree type rolling emulation.

Press crouch while moving in any WASD direction to “roll”.

The rules are the four named Torbjorn at bottom.

If you want to keep the hero facing towards starting direction: disable the start facing actions in the first Torbjorn rule.

Feel free to modify and use them.

Took them from here:

1 Like

Here’s a another example for a custom leap ability that works a bit like Hanzo’s: Z265Y

It’s used with Secondary Fire and has a cooldown of 1.5 seconds in this example.

Player Variable Function
A Saves player position once every 0.016 seconds
C Used to give the ability a cooldown of 1.5 seconds
D Used to check if the ability is currently active and to keep track of the ability’s duration
E The direction in which a player is leaping (saved so the leap can be slowed down after a certain distance)
F Used to make sure that player variable A hasn’t been updated for at least one loop

This ability uses a lot of server resources because of the very short wait time in the loop that updates the player position. The wait time could be increased for better performance but less precision when determining the leap direction.

Impulse speed and duration of the leap could be modified of course. I added a vertical angle of -5° so the ability can be used on the ground (otherwise friction with the ground would almost completely negate the impulse given).

1 Like

Thanks guy for the amazing replies, those are exactly what i was looking for!

2 Likes