Forum begins after the advertisement:


[Part 2] Better jump function

Home Forums Video Game Tutorial Series Creating a Metroidvania in Unity [Part 2] Better jump function

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #19415
    Terence
    Level 31
    Keymaster
    Helpful?
    Up
    0
    ::

    Interesting piece of code shared by PholaXXX:

    With jumps implemented this way there is a possibility to do an extra jump if I press Jump button twice within a Coyote Time range.

    To fix it, I just simply added after this check:

    if (jumpBufferCounter > 0 && coyoteTimeCounter > 0)

    a new string:

    coyoteTimeCounter = 0;

    Now, if I press the button twice, the Player performs instant double jump, so it is good to consider a timer, within which double jump is yet impossible too.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: