#Dash Won't Work Properly For 2d Platformer

1 messages · Page 1 of 1 (latest)

naive cradle
#

Whenever the player touches the ground, their dash is supposed to reset. However, when I dash off the ground the canDash variable stays true for a little, allowing me to dash twice in quick succession. How can I make sure that the canDash variable stays false immediately after I dash?

vale pelican
#

looks like a code order issue, you set canDash to false on dashing, but then set it back to true immediately in the vertical collision section

#

changing state doesn't stop the rest of the current step from running, it'll still execute the remaining free state code before swapping to dash state code the following step

#

you can either move the code for entering the dash to the bottom, so it executes last, or add an exit; inside to force it to not run the code that's after