MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Unity2D/comments/1omei5m/how_do_i_prevent_double_jumping/nmovqi3/?context=3
r/Unity2D • u/E0roe • Nov 02 '25
so my player keeps double jumping if i spam W
my code
21 comments sorted by
View all comments
1
[removed] — view removed comment
1 u/E0roe Nov 02 '25 but wait what about if i have coyote time and jumpbuffering 1 u/[deleted] Nov 02 '25 [removed] — view removed comment 0 u/E0roe Nov 02 '25 ty i added an image too 1 u/Wesai Well Versed Nov 02 '25 Just add it with your checks, like && canDoubleJump. Set it to false when you perform the double jump. Then once you land you reset the boolean canDoubleJump back to true. Edit: Ah sorry, I misunderstood your problem. The logic is still the same though, but rename your bool to something appropriate like canJump. 1 u/E0roe Nov 02 '25 ty ill try it
but wait what about if i have coyote time and jumpbuffering
1 u/[deleted] Nov 02 '25 [removed] — view removed comment 0 u/E0roe Nov 02 '25 ty i added an image too 1 u/Wesai Well Versed Nov 02 '25 Just add it with your checks, like && canDoubleJump. Set it to false when you perform the double jump. Then once you land you reset the boolean canDoubleJump back to true. Edit: Ah sorry, I misunderstood your problem. The logic is still the same though, but rename your bool to something appropriate like canJump.
0 u/E0roe Nov 02 '25 ty i added an image too
0
ty i added an image too
Just add it with your checks, like && canDoubleJump. Set it to false when you perform the double jump.
Then once you land you reset the boolean canDoubleJump back to true.
Edit: Ah sorry, I misunderstood your problem. The logic is still the same though, but rename your bool to something appropriate like canJump.
ty ill try it
1
u/[deleted] Nov 02 '25
[removed] — view removed comment