Dash System (Unreal Engine 5)
If you've been following the last two posts, we have a health and stamina system. But we need something to give us a bit more movement, a bit more zoom! First up, was a slight adjustment to the jump input to allow for a double jump. But that's still not enough zoom, we need a dash!
This was quite a simple blueprint to implement. First, I had to make an input action for the dash. I wasn't sure which key to use, I chose Q as it seemed to be the consensus on the internet (Hey, I'm a controller player!). Then I made sure to set it as a do once loop, we only want it to happen once for every time Q is pressed.
Then I got the actor rotation and the forward vector of the character and set the first part of the launch to a multiplication between the forward vector and the launch velocity via trial and error. The distance was quite nice but it felt a little flat. I added a very short delay and then another launch but this added a multiplication for the up vector on a smaller integer than the velocity. This made the character lift of the ground when they dodge, it was more immersive and when effects and sound are added later, will be a great feature for the project! Finally, another delay is added, then the loop is repeated. This was to make sure the player has to wait a little while before they can do it again.
In the video below, you'll see it working. You will also hear audio for low health and a tease of a pause menu!
Comments
Post a Comment