Hello,
I’ve reviewed two threads on this forum regarding 2D dash mechanics:
Neither of those worked for me. The first link focuses on eight possible dash directions, while the second (Megaman link) includes different dashes for ground and air in Unreal4. I work with Unreal5. I’ve also looked into videos on 3D dash mechanics, but they don’t apply to my 2D game.
I’m looking for a much simpler solution: when I press the Z key, I want my character to dash automatically in the direction he is facing on the X axis only, at a speed of 4000 cm/s for 2 seconds.
Here are some specificities:
- The same dash should work both on the ground and while jumping.
- It should function whether the character is idle or running. (So the character should go from 0 to 4000 if Idle or 1250 to 4000 is running). The end value should always be 4000.
- The character’s Z axis should remain locked during the dash to prevent falling if airborne.
Currently, my setup allows the character to dash properly, but I’m encountering 3 issues:
- The character is still falling during the dash, even though I locked the Z axis.
- After the 2 seconds, the character continues to move at 4000 cm/s instead of reverting back to the normal speed of 1250 cm/s, despite having a function in place to do so and that function being properly called (tested with print string).
- The Dash only works while Airborne. On the ground, it does nothing.
Could anyone help me identify what’s wrong with my setup down below or provide any link that could be useful?
Thank you!