How To Double Jump In Unity

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ธ.ค. 2021
  • Learn how to add double jumping to your game in Unity!
    Source code: gist.github.com/bendux/ebf825...
    SOCIAL
    Discord: / discord
    itch.io: bendux.itch.io/
    Twitter: / bendux_studios
    SUPPORT
    Buy Me a Coffee: www.buymeacoffee.com/bendux
    MUSIC
    Soul and Mind by E's Jammy Jams
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 156

  • @chez4010
    @chez4010 2 ปีที่แล้ว +69

    Just dont give up man, YOU CAN DOUBLE JUMP. Don’t let a concussion discourage you :-)

  • @gideonsparks3183
    @gideonsparks3183 4 หลายเดือนก่อน +4

    It actually makes me mad how simple this was to implement. These tutorials are great man!

  • @naimmop4481
    @naimmop4481 ปีที่แล้ว +8

    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!

  • @guille_sanchez
    @guille_sanchez 2 ปีที่แล้ว +3

    Excellent video, quickly getting to the point and the code works really smoothly, keep up the nice work!

  • @enesyilmaz95
    @enesyilmaz95 2 ปีที่แล้ว +3

    This tutorial is gold very simple and short i was also trying to make the short jump and got it here as a bonus !

  • @christopherchu2516
    @christopherchu2516 ปีที่แล้ว

    awesome short and to the point video!

  • @willwilson4486
    @willwilson4486 2 ปีที่แล้ว +2

    Love your videos, great job!

  • @giacomofranzoso3114
    @giacomofranzoso3114 5 หลายเดือนก่อน

    Very elegant solution, thank you man!

  • @prathamkorade5499
    @prathamkorade5499 ปีที่แล้ว +1

    GREAT TUTORIAL BROTHER!!!

  • @Vane_The_Local
    @Vane_The_Local ปีที่แล้ว

    THANK YOU, SO MUCH! EXACTLY WHAT I WAS LOOKING FOR

  • @InfiniteVisions612
    @InfiniteVisions612 2 ปีที่แล้ว

    The joke you made in the start was the reason i sub keep up teh work lol

  • @deluxe1697
    @deluxe1697 2 ปีที่แล้ว

    Another great video just when i need it:)

  • @neenaw
    @neenaw 2 ปีที่แล้ว

    another pogchamp tutorial my guyyy

  • @xprtYv
    @xprtYv ปีที่แล้ว

    Bro the joke at the beginning was that good amazing video! (i didnt watched it yet but i just know)

  • @Tatoie
    @Tatoie ปีที่แล้ว

    thanks! even tho this is my first time watching you, i subscribed and liked, tutorial helped!

  • @nelouchedev
    @nelouchedev ปีที่แล้ว

    It works perfectly thank you so much !

  • @thirumalaieswaran
    @thirumalaieswaran ปีที่แล้ว

    Thankyou so much 💓 i have learned double jump method Thankyou 😊✌

  • @briosh.mp4
    @briosh.mp4 ปีที่แล้ว

    ty for this amazing tutoriel ! 😄

  • @bartwillems7896
    @bartwillems7896 ปีที่แล้ว

    Hey man, you really helped me here!!!

  • @mediamermaid333
    @mediamermaid333 7 หลายเดือนก่อน +1

    Thank you!!

  • @AbdulAhad-lb4ff
    @AbdulAhad-lb4ff 2 ปีที่แล้ว

    He's back Let's goo

  • @strafe4165
    @strafe4165 4 หลายเดือนก่อน +1

    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  4 หลายเดือนก่อน

      We have a solution for that on our Discord server. Feel free to join!

  • @animationsbelike
    @animationsbelike 2 ปีที่แล้ว

    Thank you! :D

  • @deanv1265
    @deanv1265 2 ปีที่แล้ว

    Best vid in town

  •  ปีที่แล้ว +1

    Love you

  • @rusticdude2376
    @rusticdude2376 ปีที่แล้ว

    Bruh that was quick

  • @defded7733
    @defded7733 ปีที่แล้ว +1

    I really like your tutorials could you upload more videos and more often ? Please !!!!

    • @bendux
      @bendux  ปีที่แล้ว +1

      I'm currently working on a new tutorial.

  • @TheBabro93
    @TheBabro93 ปีที่แล้ว

    I put a like instantly after 14seconds when I heard the hospital story lol

  • @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

  • @martyl6424
    @martyl6424 4 หลายเดือนก่อน

    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  3 หลายเดือนก่อน

      We have a solution for that on our Discord server. Feel free to join!

  • @leefy_sf
    @leefy_sf 2 ปีที่แล้ว +1

    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 ปีที่แล้ว +5

      I definitely want to make a video about wall jumping in the future.

  • @pvpplayz2887
    @pvpplayz2887 ปีที่แล้ว +3

    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  ปีที่แล้ว +2

      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!

  • @DMaceGT
    @DMaceGT 2 ปีที่แล้ว +4

    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 ปีที่แล้ว +1

      Join our Discord server, and let's solve your problem together!

  • @thundercat9993
    @thundercat9993 ปีที่แล้ว

    thks

  • @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.

  • @joshpreston4957
    @joshpreston4957 ปีที่แล้ว +1

    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

  • @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!

  • @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  ปีที่แล้ว +1

      I definitely want to make a video about animations in the future.

  • @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

  • @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?

  • @Joksys
    @Joksys 2 ปีที่แล้ว +2

    How would you do this with the new input system?

    • @bendux
      @bendux  2 ปีที่แล้ว +2

      We have a solution for that on our Discord server. Feel free to join!

  • @skydragon601
    @skydragon601 2 ปีที่แล้ว +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?

  • @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 ปีที่แล้ว +1

      Crouching and dashing are both on my list for future videos.

    • @expertarc3861
      @expertarc3861 2 ปีที่แล้ว

      Cool

  • @houssamboudiar7689
    @houssamboudiar7689 ปีที่แล้ว

    you got me laughing bro 0:04

  • @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!

  • @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?

  • @galaxydimensions6057
    @galaxydimensions6057 9 หลายเดือนก่อน

    how would I make it so that when I fall off a ledge without jumping, I can still do the double jump?

    • @bendux
      @bendux  8 หลายเดือนก่อน

      We have a solution for that on our Discord server. Feel free to join!

  • @ratmoko1
    @ratmoko1 ปีที่แล้ว

    I'm having a hard time reconciling the double jump after adding coyote time and jump buffering. Anyone else?

    • @bendux
      @bendux  ปีที่แล้ว +1

      We have a solution for that on our Discord server. Feel free to join!

  • @chez4010
    @chez4010 2 ปีที่แล้ว +1

    Haha nice another vid

  • @Blaxe75
    @Blaxe75 ปีที่แล้ว

    why does the github servers HAVE TO BE DOWN error 500

  • @Isotonicdev
    @Isotonicdev 6 หลายเดือนก่อน

    how do i add this with wall slide and wall jump

    • @bendux
      @bendux  6 หลายเดือนก่อน

      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 ปีที่แล้ว +1

      I made it myself with Unity's particle system.

  • @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 ปีที่แล้ว

      @@loopgamer01 i could not find it, can you please help me?

  • @SaijeMage
    @SaijeMage 2 ปีที่แล้ว

    im having trouble getting this to work after setting up coyote time and jumpbuffer

    • @bendux
      @bendux  2 ปีที่แล้ว +1

      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

  • @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!!

  • @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.

  • @hiimenvy6174
    @hiimenvy6174 ปีที่แล้ว

    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  ปีที่แล้ว +1

      Setting it to false is not the same as setting it to its opposite value.

    • @hiimenvy6174
      @hiimenvy6174 ปีที่แล้ว

      @@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 ปีที่แล้ว

      Is it just because it's false by default?

    • @hiimenvy6174
      @hiimenvy6174 ปีที่แล้ว

      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.

  • @-._122
    @-._122 11 หลายเดือนก่อน +1

    what key would I hit to jump

    • @-._122
      @-._122 11 หลายเดือนก่อน

      can some one please tell me bc im clicking space but now jumping

    • @bendux
      @bendux  11 หลายเดือนก่อน

      Edit > Project Settings > Input Manager

    • @-._122
      @-._122 11 หลายเดือนก่อน

      @@bendux thanks it works now
      also can you make a enemy tutorial?

    • @bendux
      @bendux  11 หลายเดือนก่อน

      @@-._122 I definitely want to make a video about enemies in the future.

    • @-._122
      @-._122 11 หลายเดือนก่อน

      @@bendux yes it would be great
      also keep up the great work

  • @elostolol0197
    @elostolol0197 2 ปีที่แล้ว

    Nice dude. But I hope u make more videos. 2vid / weeks 😆

  • @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?

  • @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.

  • @jaexuka
    @jaexuka 7 หลายเดือนก่อน

    add animation

  • @ghostkiller2864
    @ghostkiller2864 2 ปีที่แล้ว

    im having trouble , the player jumps too high

    • @bendux
      @bendux  2 ปีที่แล้ว +1

      Increase the gravity scale of your player's Rigidbody 2D component, or decrease the jumping power at the top of the script.

  • @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.

  • @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.

  • @DevNoob
    @DevNoob 2 ปีที่แล้ว

    lmfao double jumping in real life. Can you make a tutorial on that?

  • @enochwade9010
    @enochwade9010 ปีที่แล้ว

    I can’t incorporate this double jump into my existing script and it’s driving me insane

    • @bendux
      @bendux  ปีที่แล้ว

      Would you like to show me your code on Discord?

    • @enochwade9010
      @enochwade9010 ปีที่แล้ว

      @@bendux yes absolutely!!!

    • @enochwade9010
      @enochwade9010 ปีที่แล้ว

      I’d be so flipping happy!!!!

  • @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.

  • @rolingah
    @rolingah 2 ปีที่แล้ว

    i got infinity jumping following this

    • @bendux
      @bendux  2 ปีที่แล้ว

      Would you like to show me your code on Discord?

  • @MarvelAnchor
    @MarvelAnchor ปีที่แล้ว

    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.

  • @gg-ti6or
    @gg-ti6or 2 ปีที่แล้ว

    What i need to putin animator

    • @bendux
      @bendux  2 ปีที่แล้ว +1

      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.

  • @iojmx3387
    @iojmx3387 ปีที่แล้ว +1

    nothing is clear . dislike

  • @loukmankoh1544
    @loukmankoh1544 ปีที่แล้ว +1

    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  ปีที่แล้ว +1

      @@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  ปีที่แล้ว +1

      Of course!

    • @ckjax3428
      @ckjax3428 ปีที่แล้ว

      @@bendux I DM u yesterday!