So I made a dash system that speeds up the player until you run out of fuel.
You can cancel the dash by releasing the input key (CTRL)
I want there to be a minimum amount of time (0.3 seconds) before you can cancel the dash while dashing.
So for example: You press and immediatly release the dash key, but that doesn’t stop the dash, you always dash and can’t cancel it for the first 0.3 seconds and after that, you can cancel.
The cancelling works but the 0.3 seconds thing doesn’t
I’ve spend 2 hours trying to figure this out but i couldn’t.
I really need help for this.
(All the dash code is in the images)
My variables
The “IsFlying” variable isn’t important here i think since that’s for a different ability.