Code A PERFECT PLATFORMER JUMP | Godot 4 Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ม.ค. 2025

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

  • @brochlarkwright6016
    @brochlarkwright6016 2 หลายเดือนก่อน +5

    If you want to still jump after leaving a ledge and coyote time, but penalize their jumps (ex: you have 2 max jumps, we penalize them 1 jump, so we will still get a jump but only 1.)
    add a variable called AirJumpPenalty into the constants and add this code in HandleJump() after the coyote timer if statement.
    if ((jumps

    • @BiLLzDevs
      @BiLLzDevs  2 หลายเดือนก่อน +1

      Love the mechanic and the solution you came up with, thanks for sharing it!

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

      Yup that's right, I did something similar to this and it works perfectly.

  • @brochlarkwright6016
    @brochlarkwright6016 2 หลายเดือนก่อน +1

    Finally a jump video that explains it in a way I can understand, 10/10 video!

  • @RecordofRadio
    @RecordofRadio 2 หลายเดือนก่อน +2

    great video. if you export the values you can update them on the fly and your iteration time might be faster, as far as honing in your final values. Or additionally, you might want some of that hang time and things like that for different abilities or skills, maybe an item that lets you hover, or something, and you could then knock them all out really quickly. But yeah, this seems like a solid approach.

    • @BiLLzDevs
      @BiLLzDevs  2 หลายเดือนก่อน +1

      Agreed! Exporting is a fantastic way to quickly adjust values and fine tune a jump

  • @sigilhunter3199
    @sigilhunter3199 2 หลายเดือนก่อน +2

    Very informative. Imo the feel of character movement is often something that gets overlooked.

  • @LeCoffreaFlonflons
    @LeCoffreaFlonflons 2 หลายเดือนก่อน

    That was awesome ! The instructions are so clears it make me want to try to experiment with the code to have other mechanics (I'm thinking of falling slower if the player keep the jump button pressed or something like these mechanics we find in Super Mario Wonder).
    That's great tutorials !

    • @BiLLzDevs
      @BiLLzDevs  2 หลายเดือนก่อน

      Go do some experimentation, it’s a great way to learn and reinforce programming skills!

  • @breadisarting4044
    @breadisarting4044 2 หลายเดือนก่อน +2

    Thanks for the insight, man!

  • @lorein_4368
    @lorein_4368 2 วันที่ผ่านมา

    i did it, it works pretty good! Thanks for tutorial!😊

    • @BiLLzDevs
      @BiLLzDevs  13 ชั่วโมงที่ผ่านมา

      You're welcome!

  • @sunnysnow2226
    @sunnysnow2226 2 หลายเดือนก่อน

    @2:20 No need state machine, just check if velocity is positive or negative.

    • @BiLLzDevs
      @BiLLzDevs  2 หลายเดือนก่อน

      True, you could do it that way but I feel the logic is cleaner and more compartmentalized in a state machine 🤷🏼‍♂️

  • @greenya84
    @greenya84 2 หลายเดือนก่อน

    Great detailed explanation. Thank you

    • @BiLLzDevs
      @BiLLzDevs  2 หลายเดือนก่อน

      You're very welcome!

  • @roycegarvin
    @roycegarvin 2 หลายเดือนก่อน +1

    This is awesome thank you.

    • @BiLLzDevs
      @BiLLzDevs  2 หลายเดือนก่อน

      You're very welcome!

  • @sohailrahman2637
    @sohailrahman2637 2 หลายเดือนก่อน +2

    if I follow ur variables and inputs can i build it with visual script (no code experience yet) or may be just use both visual script and code together to apply

    • @BiLLzDevs
      @BiLLzDevs  2 หลายเดือนก่อน

      I am unfamiliar with any visual scripting extensions in Godot, but you should be able to implement this in it

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

    I'm having a problem with the Jump Input Buffering, and while testing it discovered something else:
    I'm really new with Godot and coding in general, so maybe there is something i'm not seeing.
    The first problem is with the JumpBuffering: It works always, the timer starts but when it reachs 0 starts again. So it doesn't matter when i press it. if i'm in the air as soon as it touches the floor it will jump again.
    I tried to create a code that stops the timer when it reaches 0, but it didn't work.
    And the second problem is that i can jump while i'm falling if i didn't jump firs. If i fall from a platform i can jump midair.
    And these both problems happen at the same time. if I fall from a platform and jump, I will jump midair and when i touch the floor will jump again.

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

      In your JumpBuffer timer node, is auto start checked? Auto start needs to be disabled otherwise the timer will continuously start and register as the input being buffered. Make sure the coyote timer also has auto start disabled.

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

      @@BiLLzDevs First of all: Thanks for the answer.
      I didn't start with the coyote timer, i want to make sure that everything is working properly before moving to the next step. The Timer's autostart was alredy disabled, but it restarts anyway.
      Well. By writting this comment I find out a way to kind of solve it.
      i'm pretty sure that there is a better way to do this but i don't have the knowledge to find it yet. So, i wrote a way to stop the countdown when it reaches a really low value on the HandleJumpBuffer func. And by rising the timer the same time it takes it should work the same way.
      if (JumpBufferTimer.time_left < 0.03):
      JumpBufferTimer.stop()
      Now, it also solved (don't know why) the problem that if i jump midair while falling it will jump again AND start the timer.
      It still jumps, but it doesn't start the timer anymore.
      the remaining problem is that jump. i want the character to jump only if it's on the floor, that's easy at this point. but if i add an extra jump that doesn't work.
      I used the code that Brochlark said for the penalty and it worket for 2 jumps (even if it says MaxJumps = 1). And it can double Jump only if i jump from the floor and a single jump if i fall from a platform.
      I feel at this point that i'm doing a mess with the code. At the end with the HandleJump it ended like this:
      func HandleJump():
      if ((!is_on_floor() and (jumps 0)) and (jumps < MaxJumps)):
      if ((jumps

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

      Seems like you have kinda got it sorted out! If you keep running into issues, the source code is available on my itch.io page that is linked in the description. You can use that to make sure you have everything set up properly

    • @salsatuna177
      @salsatuna177 14 วันที่ผ่านมา

      for anyone who still gets this problem with "Autostart" disabled (like me), just make sure the box for "One Shot" is enabled in the Jump Buffer Timer's node properties in the inspector

    • @BiLLzDevs
      @BiLLzDevs  13 วันที่ผ่านมา +1

      @ Exactly!

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

    Can you make video entirely dedicated to how to create state machines the way u done here 😊 for 2d anf 3d game and please do video how to create 3d world by grid map no videos are sufficient to understand these concepts in depth

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

      I do have a video dedicated to the state machine used in this video. Unfortunately, I haven’t done any work in 3D so I don’t know if I would be any help with that, sorry!

  • @cj-cv7zv
    @cj-cv7zv 17 วันที่ผ่านมา

    Love this tutorial, seemed to fix the issue i was having after the last episode. However, my character is now able to double jump but only after a coyote jump, any ideas?

    • @BiLLzDevs
      @BiLLzDevs  17 วันที่ผ่านมา

      @@cj-cv7zv interesting… mine works on the ground. What does your HandleJump function look like?

  • @AltonT90
    @AltonT90 2 หลายเดือนก่อน +1

    yours links doesn't work :(

    • @BiLLzDevs
      @BiLLzDevs  2 หลายเดือนก่อน

      I just fixed them for you

  • @yusarimahubara
    @yusarimahubara 2 หลายเดือนก่อน

    What's the point to show the code and not the final result?

    • @BiLLzDevs
      @BiLLzDevs  2 หลายเดือนก่อน +3

      What do you mean final result?

    • @axivy4684
      @axivy4684 2 หลายเดือนก่อน +2

      @@BiLLzDevs nah fr wat th hell is he saying