skinwalker
Member
Hey guys,
I have spent the last 2 days trying to create a Dash ability and while it mechanically works it's not as responsive as I want it to be.
The requirements: I want the player to be able to dash in the direction of the current input or look direction in case the player is only pressing "W" and I want to be able to dash 3 times in a row.
The problem: Lets say Im holding down "A" and I dash left then immediately hold down "D" to dash right what will happen is the character will dash left instead of right because the velocity has not built up enough to move right, but if I wait 1 second between each dash it works really well.
The perfect solution: I need a way to get the player velocity to its maximum (or desired velocity) possible as soon as the player changes key presses. I wont actually set that velocity to the player just need it for the dash direction.
My current code: (the backwards dash solution is not a good one but I put it as an experiment)
I have spent the last 2 days trying to create a Dash ability and while it mechanically works it's not as responsive as I want it to be.
The requirements: I want the player to be able to dash in the direction of the current input or look direction in case the player is only pressing "W" and I want to be able to dash 3 times in a row.
The problem: Lets say Im holding down "A" and I dash left then immediately hold down "D" to dash right what will happen is the character will dash left instead of right because the velocity has not built up enough to move right, but if I wait 1 second between each dash it works really well.
The perfect solution: I need a way to get the player velocity to its maximum (or desired velocity) possible as soon as the player changes key presses. I wont actually set that velocity to the player just need it for the dash direction.
My current code: (the backwards dash solution is not a good one but I put it as an experiment)
public class Dash : Ability { protected override void Ability - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
pastebin.com