How To Double Jump In Unity

  Рет қаралды 50,085

bendux

bendux

Күн бұрын

Learn how to add double jumping to your game in Unity!
Source code: gist.github.co...
SOCIAL
Discord: / discord
itch.io: bendux.itch.io/
Twitter: / bendux_studios
SUPPORT
Buy Me a Coffee: www.buymeacoff...
MUSIC
Soul and Mind by E's Jammy Jams

Пікірлер: 155
@gideonsparks3183
@gideonsparks3183 7 ай бұрын
It actually makes me mad how simple this was to implement. These tutorials are great man!
@chez4010
@chez4010 2 жыл бұрын
Just dont give up man, YOU CAN DOUBLE JUMP. Don’t let a concussion discourage you :-)
@jonnchambers7606
@jonnchambers7606 Жыл бұрын
Haha...good one🤣
@neilaszemgulys6754
@neilaszemgulys6754 Жыл бұрын
Only true legends can do it and he truly IS a legend.
@kiacoder1226
@kiacoder1226 10 ай бұрын
haha
@AkiDevelops
@AkiDevelops 10 ай бұрын
@@neilaszemgulys6754 so he can indeed do it!
@naimmop4481
@naimmop4481 Жыл бұрын
Your style of coding in these tutorials are very impressive, I would've never thought of using boolean variables to do this, normally I would use integers and have them count the jumps. Amazing video brother!!!
@mounirrouibi2669
@mounirrouibi2669 Жыл бұрын
Why am I just discovering this goat! Instructive, short, and well-edited videos topped with a great sense of humor. I am just impressed!
@enesyilmaz95
@enesyilmaz95 2 жыл бұрын
This tutorial is gold very simple and short i was also trying to make the short jump and got it here as a bonus !
@guille_sanchez
@guille_sanchez 2 жыл бұрын
Excellent video, quickly getting to the point and the code works really smoothly, keep up the nice work!
@giacomofranzoso3114
@giacomofranzoso3114 9 ай бұрын
Very elegant solution, thank you man!
@christopherchu2516
@christopherchu2516 2 жыл бұрын
awesome short and to the point video!
@strafe4165
@strafe4165 8 ай бұрын
Super helpful, loving your tutorials and content!! I do have a question though, and that is if I'm using coyote time and jump buffering, how would I implement this double jump?
@bendux
@bendux 7 ай бұрын
We have a solution for that on our Discord server. Feel free to join!
@AKIRAaims
@AKIRAaims Жыл бұрын
Bro the joke at the beginning was that good amazing video! (i didnt watched it yet but i just know)
@prathamkorade5499
@prathamkorade5499 2 жыл бұрын
GREAT TUTORIAL BROTHER!!!
@InfiniteVisions612
@InfiniteVisions612 2 жыл бұрын
The joke you made in the start was the reason i sub keep up teh work lol
@mediamermaid333
@mediamermaid333 11 ай бұрын
Thank you!!
@willwilson4486
@willwilson4486 2 жыл бұрын
Love your videos, great job!
@pvpplayz2887
@pvpplayz2887 Жыл бұрын
Hey! if you wouldn't mind would you do a tutorial on how to make a jump like in Celeste, in which you can press jump before you reach the ground and it still goes through when you do? I think it would be super helpful for a lot of us!
@bendux
@bendux Жыл бұрын
I already have a video about coyote time and jump buffering on my channel.
@pvpplayz2887
@pvpplayz2887 Жыл бұрын
@@bendux Yea I found it just after I commented I'm super sorry, thank you for giving the community such awesome tutorials!
@VaneTheLocal
@VaneTheLocal Жыл бұрын
THANK YOU, SO MUCH! EXACTLY WHAT I WAS LOOKING FOR
@neenaw
@neenaw 2 жыл бұрын
another pogchamp tutorial my guyyy
@DMaceGT
@DMaceGT 2 жыл бұрын
This does work but I want to set a power up which will grant me double jump and can be used on every scenes after that instead of making it always active on the player. If you can make a video on that, Thank you in advance :3
@bendux
@bendux 2 жыл бұрын
Join our Discord server, and let's solve your problem together!
@Tatoie
@Tatoie Жыл бұрын
thanks! even tho this is my first time watching you, i subscribed and liked, tutorial helped!
@TheBabro93
@TheBabro93 Жыл бұрын
I put a like instantly after 14seconds when I heard the hospital story lol
@leefy_sf
@leefy_sf 2 жыл бұрын
hey I have a suggestion for a video! can you make a tutorial for wall jumping? Because I've been trying to add wall jumping to my game for a long time now and tutorials I find don't seem to work, I'd really appreciate you making it! I understand if you can't though. Keep up the good work!
@bendux
@bendux 2 жыл бұрын
I definitely want to make a video about wall jumping in the future.
@briosh.mp4
@briosh.mp4 Жыл бұрын
ty for this amazing tutoriel ! 😄
@nelouchedev
@nelouchedev Жыл бұрын
It works perfectly thank you so much !
@Roughartwork
@Roughartwork 2 жыл бұрын
Thankyou so much 💓 i have learned double jump method Thankyou 😊✌
@thatGameDevGuy
@thatGameDevGuy Жыл бұрын
Bruh that was quick
@bartwillems7896
@bartwillems7896 2 жыл бұрын
Hey man, you really helped me here!!!
@deluxe1697
@deluxe1697 2 жыл бұрын
Another great video just when i need it:)
@martyl6424
@martyl6424 7 ай бұрын
great vid, but how could you implement this so you are able to double jump from wall too ? i looked your walljump tutorial also but somehow i cant combine this doublejump with walljump
@bendux
@bendux 7 ай бұрын
We have a solution for that on our Discord server. Feel free to join!
@skydragon601
@skydragon601 2 жыл бұрын
So whenever I write a line of code with "isGrounded" in it, it says it doesn't exist in the current context, so I wrote the line "void isGrounded() {}", and after I did that, I typed the line "if (isGrounded() | | doublejump)", it says that the operator '| |' cannot be applied to operands of type 'void' and 'bool'. And even when I put operator "&&" in the line "if (isGrounded() && !Input.GetButton("Jump"))" it says the same thing about '&&', so what do I do about the isGrounded problem?
@bendux
@bendux 2 жыл бұрын
Would you like to show me your code on Discord?
@skydragon601
@skydragon601 2 жыл бұрын
@@bendux sure
@snipermonke6812
@snipermonke6812 Жыл бұрын
instead of 'void', write 'bool isGrounded()'
@sogyshorts5662
@sogyshorts5662 Жыл бұрын
I have the same problem. Did you solve it?
@AbdulAhad-lb4ff
@AbdulAhad-lb4ff 2 жыл бұрын
He's back Let's goo
@-._122
@-._122 Жыл бұрын
what key would I hit to jump
@-._122
@-._122 Жыл бұрын
can some one please tell me bc im clicking space but now jumping
@bendux
@bendux Жыл бұрын
Edit > Project Settings > Input Manager
@-._122
@-._122 Жыл бұрын
@@bendux thanks it works now also can you make a enemy tutorial?
@bendux
@bendux Жыл бұрын
@@-._122 I definitely want to make a video about enemies in the future.
@-._122
@-._122 Жыл бұрын
@@bendux yes it would be great also keep up the great work
@spemeryt
@spemeryt 2 жыл бұрын
ello, great video mate! May I know what video did you do the animation for the player? and how can I make the snowy effect
@bendux
@bendux 2 жыл бұрын
I learned everything I know about animations from Brackeys. I definitely want to make a video about Unity's particle system in the future.
@spemeryt
@spemeryt 2 жыл бұрын
@@bendux Thanks so much mate, I'm looking into it :D
@laughingstar3945
@laughingstar3945 Жыл бұрын
Hey man i kinda dont understand the syntax for the Vector2 when you put the doubleJumpingPower
@bendux
@bendux Жыл бұрын
learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/conditional-operator
@joshpreston4957
@joshpreston4957 Жыл бұрын
I was stuck for awhile notice that in the If statement that sends double jump to false that he is using the method GetButton() and not the more common GetButtonDown(). That is what fixed it for me: if (IsGrounded() && !Input.GetButton("Jump"))
@brucelee7782
@brucelee7782 Жыл бұрын
omg same problem, thank you brother
@Joksys
@Joksys 2 жыл бұрын
How would you do this with the new input system?
@bendux
@bendux 2 жыл бұрын
We have a solution for that on our Discord server. Feel free to join!
@defded7733
@defded7733 Жыл бұрын
I really like your tutorials could you upload more videos and more often ? Please !!!!
@bendux
@bendux Жыл бұрын
I'm currently working on a new tutorial.
@deanv1265
@deanv1265 2 жыл бұрын
Best vid in town
@houssamboudiar7689
@houssamboudiar7689 2 жыл бұрын
you got me laughing bro 0:04
@animationsbelike
@animationsbelike 2 жыл бұрын
Thank you! :D
@aniime4006
@aniime4006 Жыл бұрын
Do you have a video showing how to change character animations when active compared to static character animations?
@aniime4006
@aniime4006 Жыл бұрын
like your character when running, it will move its feet
@bendux
@bendux Жыл бұрын
I definitely want to make a video about animations in the future.
@sigma9.90
@sigma9.90 Ай бұрын
when using this, my player wont jump half the time, i have to press the button a good few times before it works
Жыл бұрын
Love you
@Gigga_Appel
@Gigga_Appel Жыл бұрын
Please can u make a tutorial abt the snow flakes in the back??
@bendux
@bendux Жыл бұрын
I definitely want to make a video about Unity's particle system in the future.
@bigbossross286
@bigbossross286 Жыл бұрын
How does this work with Coyote timing and buffering jumps? I can't seem to get all of them to work at the same time
@bendux
@bendux Жыл бұрын
We have a solution for that on our Discord server. Feel free to join!
@gilgaming6858
@gilgaming6858 Жыл бұрын
is there a way to limit the double jumps, i have a problem where when the player reaches its apex it will give it a second jump.
@bendux
@bendux Жыл бұрын
Would you like to show me your code on Discord?
@meltedistaken
@meltedistaken Жыл бұрын
Would there be a way to where if I walk off of a ledge, I have the jump? Currently I have to jump to activate the ability to double jump.
@bendux
@bendux Жыл бұрын
We have a solution for that on our Discord server. Feel free to join!
@gifex_
@gifex_ 2 жыл бұрын
can i ask from where you have this snow in video?
@bendux
@bendux 2 жыл бұрын
I made it myself with Unity's particle system.
@Emu-
@Emu- Жыл бұрын
will this also work for Character controllers or just rigidbodies
@bendux
@bendux Жыл бұрын
What do you mean?
@Emu-
@Emu- Жыл бұрын
@@bendux Can this script work with Character Controller Component or strictly a Rigid Body Character?
@bendux
@bendux Жыл бұрын
@@Emu- The same principle can be applied to other character controllers.
@tonenfich4582
@tonenfich4582 Жыл бұрын
In my project the ground layer check just dosent work i can set the ground layer to everything i want and i can just jump every time you can just double jump how ofthen you want
@bendux
@bendux Жыл бұрын
Would you like to show me your code on Discord?
@chez4010
@chez4010 2 жыл бұрын
Haha nice another vid
@expertarc3861
@expertarc3861 2 жыл бұрын
Can you do a video about croching and dashing as im having trouble finding a good tutorial on it
@bendux
@bendux 2 жыл бұрын
Crouching and dashing are both on my list for future videos.
@expertarc3861
@expertarc3861 2 жыл бұрын
Cool
@nxhackerbg1201
@nxhackerbg1201 Жыл бұрын
can you help me I set the jump button to "W" and wrote a code so that double jump activates once the player is in the air and now whenever I hit the "W" button it takes like really less time for the player to reach the air and double jump subtracts in fraction of second and the player cannot do double jump after that. What do I do? If you are interested I can send you the code in discord
@bendux
@bendux Жыл бұрын
Join our Discord server, and let's solve your problem together!
@nxhackerbg1201
@nxhackerbg1201 Жыл бұрын
@@bendux OMG sure!!
@Blaxe75
@Blaxe75 Жыл бұрын
why does the github servers HAVE TO BE DOWN error 500
@enochwade9010
@enochwade9010 2 жыл бұрын
I can’t incorporate this double jump into my existing script and it’s driving me insane
@bendux
@bendux 2 жыл бұрын
Would you like to show me your code on Discord?
@enochwade9010
@enochwade9010 2 жыл бұрын
@@bendux yes absolutely!!!
@enochwade9010
@enochwade9010 2 жыл бұрын
I’d be so flipping happy!!!!
@hiimenvy6174
@hiimenvy6174 2 жыл бұрын
I know this video is old but I was wondering why we have to set doublejump = !doublejump instead of just setting it to false? I'm confused as to why that doesn't do the same thing.
@bendux
@bendux 2 жыл бұрын
Setting it to false is not the same as setting it to its opposite value.
@hiimenvy6174
@hiimenvy6174 2 жыл бұрын
@@bendux I get that but why? I starts off as just true, and then you set it to the opposite value which should be false right? I just don't understand where the difference is coming from.
@hiimenvy6174
@hiimenvy6174 2 жыл бұрын
Is it just because it's false by default?
@hiimenvy6174
@hiimenvy6174 2 жыл бұрын
Alright, I figured it out. Instead of setting it to false, we can set it to true and it will simulate the same logic. I just assumed for some reason that c# defaluted booleans to true, not sure why. Also, even if it did we still wouldn't want to set it to false anyway because then we couldn't double jump. Alright, thanks for the help.
@loopgamer01
@loopgamer01 2 жыл бұрын
what do you do if you added the coyote time and jump buffering codes Thanks
@bendux
@bendux 2 жыл бұрын
We have a solution for that on our Discord server. Feel free to join!
@loopgamer01
@loopgamer01 2 жыл бұрын
Found it and it worked Thanks!
@nuku142
@nuku142 2 жыл бұрын
@@loopgamer01 i could not find it, can you please help me?
@Benkaera
@Benkaera Жыл бұрын
Dj is working, but when he falling from a wall down. i cannot jump
@bendux
@bendux Жыл бұрын
Would you like to show me your code on Discord?
@SaijeMage
@SaijeMage 2 жыл бұрын
im having trouble getting this to work after setting up coyote time and jumpbuffer
@bendux
@bendux 2 жыл бұрын
We have a solution for that on our Discord server. Feel free to join!
@SaijeMage
@SaijeMage 2 жыл бұрын
@@bendux awesome thank you ! those solutions worked perfectly
@ratmoko1
@ratmoko1 Жыл бұрын
I'm having a hard time reconciling the double jump after adding coyote time and jump buffering. Anyone else?
@bendux
@bendux Жыл бұрын
We have a solution for that on our Discord server. Feel free to join!
@thundershadow1837
@thundershadow1837 2 жыл бұрын
Hello, I really like your videos it helped me a lot with my unity project but I want to ask something in the video that you teach us how to make split-screen in unity you already had 2 controllable players every other video I watch about local multiplayer you had to move the controller to add a player but that doesn't work with the fighting game that I am making so can you make a video about the local multiplayer?
@bendux
@bendux 2 жыл бұрын
I definitely want to make a video about local multiplayer in the future.
@Isotonicdev
@Isotonicdev 10 ай бұрын
how do i add this with wall slide and wall jump
@bendux
@bendux 9 ай бұрын
We have a solution for that on our Discord server. Feel free to join!
@thundercat9993
@thundercat9993 Жыл бұрын
thks
@maksimnarrates1826
@maksimnarrates1826 Жыл бұрын
Didn't work for me - the player can jump indefinitely. And console says: "Parameter "Speed" doesn't exist"
@bendux
@bendux Жыл бұрын
Make sure that your player and the ground are not on the same layer. By the way, there is a link to the source code in the description.
@ghostkiller2864
@ghostkiller2864 2 жыл бұрын
im having trouble , the player jumps too high
@bendux
@bendux 2 жыл бұрын
Increase the gravity scale of your player's Rigidbody 2D component, or decrease the jumping power at the top of the script.
@DevNoob
@DevNoob 2 жыл бұрын
lmfao double jumping in real life. Can you make a tutorial on that?
@rolingah
@rolingah 2 жыл бұрын
i got infinity jumping following this
@bendux
@bendux 2 жыл бұрын
Would you like to show me your code on Discord?
@Kazu173_
@Kazu173_ Жыл бұрын
it didnt work for me and i didnt get any errors
@bendux
@bendux Жыл бұрын
There is a link to the source code in the description.
@srivikas1834
@srivikas1834 2 жыл бұрын
Anyone else have a problem where the player keeps on jumping when you keep pressing space?
@srivikas1834
@srivikas1834 2 жыл бұрын
Nevermind, I just forgot to add the ground layer to Ground
@bendux
@bendux 2 жыл бұрын
I'm glad you were able to fix it.
@srivikas1834
@srivikas1834 2 жыл бұрын
@@bendux Thank you for your work. It really helps people like me a lot.
@jaexuka
@jaexuka 11 ай бұрын
add animation
@乲
@乲 Жыл бұрын
copied the code and well i can infinitely jump soooo (also i only want 1 jump btw i have really been struggling to get it as a begginer hope u can help)
@bendux
@bendux Жыл бұрын
Make sure that your player and the ground are not on the same layer.
@iojmx3387
@iojmx3387 Жыл бұрын
nothing is clear . dislike
@elostolol0197
@elostolol0197 2 жыл бұрын
Nice dude. But I hope u make more videos. 2vid / weeks 😆
@gg-ti6or
@gg-ti6or 2 жыл бұрын
What i need to putin animator
@bendux
@bendux 2 жыл бұрын
You don't need the animator for double jumping.
@luckysantillan7514
@luckysantillan7514 Жыл бұрын
the jump on my game is not working hahah even one jump not working hahah
@bendux
@bendux Жыл бұрын
Would you like to show me your code on Discord?
@luckysantillan7514
@luckysantillan7514 Жыл бұрын
@@bendux yes why not just send you discord link
@bendux
@bendux Жыл бұрын
@@luckysantillan7514 There is a link in the description.
@loukmankoh1544
@loukmankoh1544 Жыл бұрын
why i copy it and paste and hit play i got more than +999 eror with the same eror is UnassignedReferenceException: The variable animator of pm has not been assigned. You probably need to assign the animator variable of the pm script in the inspector. UnityEngine.Animator.SetFloat (System.String name, System.Single value) (at :0)
@bendux
@bendux Жыл бұрын
You don't need the animator for double jumping.
@loukmankoh1544
@loukmankoh1544 Жыл бұрын
@@bendux yh it took me 2 hours to fix it and its fine
@bendux
@bendux Жыл бұрын
@@loukmankoh1544 I'm glad you were able to fix it.
@loukmankoh1544
@loukmankoh1544 Жыл бұрын
@@bendux thx man
@ckjax3428
@ckjax3428 Жыл бұрын
I ran into a prob can I dm u in discord?
@bendux
@bendux Жыл бұрын
Of course!
@ckjax3428
@ckjax3428 Жыл бұрын
@@bendux I DM u yesterday!
2D Player Movement In Unity
5:34
bendux
Рет қаралды 452 М.
How To Wall Slide & Wall Jump In Unity
6:38
bendux
Рет қаралды 74 М.
兔子姐姐最终逃走了吗?#小丑#兔子警官#家庭
00:58
小蚂蚁和小宇宙
Рет қаралды 14 МЛН
Colorful Pasta Painting for Fun Times! 🍝 🎨
00:29
La La Learn
Рет қаралды 308 МЛН
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 106 МЛН
I Paid Fiverr Game Developers to Make the Same Game
10:25
BadGameDev
Рет қаралды 733 М.
Coyote Time & Jump Buffering In Unity
3:48
bendux
Рет қаралды 82 М.
How to jump in Unity (with or without physics)
16:09
Game Dev Beginner
Рет қаралды 47 М.
Improve your Platformer’s Jump (and Wall Jump) | Unity
8:12
Dawnosaur
Рет қаралды 122 М.
How I Beat The Password Game
39:53
Bog
Рет қаралды 1,9 МЛН
This Single Rule Underpins All Of Physics
32:44
Veritasium
Рет қаралды 3,3 МЛН
I Optimised My Game Engine Up To 12000 FPS
11:58
Vercidium
Рет қаралды 707 М.
Oh, wait, actually the best Wordle opener is not “crane”…
10:53
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,2 МЛН
兔子姐姐最终逃走了吗?#小丑#兔子警官#家庭
00:58
小蚂蚁和小宇宙
Рет қаралды 14 МЛН