How do I prevent player to jump higher when he's at maxspeed ?

0 favourites
  • 14 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • Hello,

    I have an issue with my platformer character. It's an issue I have with the template.

    When I'm accelerating, the player jumps higher than when he's jumping from the idle position. Is it possible to prevent this ? To set a max jump height for example ?

    Tagged:

  • depends on how you setup the jump action. we need to see those events for jumping and how the platformer/jumping behavior is setup.

    in theory u could set a variable max-jump and set the vertical Y motion to it once it passes a surtain amount, it can also be that it pushes u higher cause of the inertia or sustain jump(the platform setting that pushes u higher the more u keep the jump button down) setting from the platformer if that is still a feature.

  • There's no sustain jump. You can reproduce this behavior in the platormer template.

    Maybe it's the inertia but I don't know how to prevent it.

  • i just tested it out with the default settings of platformer, it acts the same if i move.

    it's probably ur acceleration being higher than the deceleration make sure they are equal.(that is why i asked for a screenshot or setting values from your project, it might be some settings are not properly set)

    however u can override the default settings by gapping sort of speak the max jump to a surtain value by changing the player.Platform.VectorY

    and say in ur conditions on jump or up arrow/w key pressed player set Self.Platform.VectorY-(your value)

    default jump strength is 650 (that is not taken in account the moment u use the above custom vector.y) if you want to lower it just change -(your value) to desired strength.

    u might also want to disable the default controls and create custom ones by events like i explained above.

    if it's not fixing the issue, it's probably some event in ur project that interferes with acceleration / deceleration /gravity / game time scale.

    if u want to revert the settings of platformer behavior without removing the behavior and you can't remember what it was by default here are the values

  • Thanks for you help, I tried everything but it still doesn't work. It's very subtile but the player keeps getting higher than the highest jump at idle state.

    I'll do a project tomorrow to show it.

  • ok, try replicate your exact jumping system you have issues with it now, no need for other events(that is if other events are not movement based, if they are movement based please include those also in the same order/values).

    and will take a look at it.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I made a project with only the behavior I want to show :

    ufile.io/0qf0o

    You cannot jump above the two squares when you're next to the squares but if you move from the left corner and you jump, you can go above the two squares. Not everytime but sometimes and it's very disturbing.

    Thanks for your help !

  • change is W down to W was pressed. that fixes it on my end. and reduce the power jump to 450 instead of 460.

  • Unfortunately, not for me. The issue doesn't show everytime so it's easy to not see it but thanks a lot for your help!

  • u have to also reduce the power of the jump to 450 sorry i edited the above reply to late. the issue is the jump takes in account the speed ur running at the faster u run the higher u jump like in real life...

  • Yes it could solve it if the platforms were static but the core concept of my game is to create platforms at the player position so the platforms could be anywhere. So reducing the power fixs the issue just for this case but it's possible that a platform will be a little lower.

  • Yes it could solve it if the platforms were static but the core concept of my game is to create platforms at the player position so the platforms could be anywhere. So reducing the power fixs the issue just for this case but it's possible that a platform will be a little lower.

    you lost me there, i can't understand what your trying to achieve without seeing it.

    but if u have a position at which u spawn the platforms u then calculate the distance from bottom margin of the 1st platform to the position of the 2nd block or 3rd block topmargin u spawning and set the distance to the players power jump. you will also have to adjust the gravity/fall speed and all those little values to match and react properly.

    since u using 32 pixels by 32 pixels blocks u can also set the power jump to whatever is in front of the player so if u have 2 blocks u can set jump strength to 32 * N number of blocks stacked on top of each other in front of player at a distance of 100 pixels or less lets say.

    edited: example updated pick objects that are closer than 64 pixels distance and alter player jump based on it... isn't perfect but somewhere around there.

    it might not be what ur looking for but atleast will give u an idea.

  • Thank you very much for those ideas.

    To be simple, you said "the issue is the jump takes in account the speed ur running at the faster u run the higher u jump like in real life..." and I would like to remove this issue. I would like that the jump doesn't take in account the speed. I don't want a jump like in real life if it's possible. I'm still searching a way to do it.

  • Maybe I found a solution by tweaking jumping strengh when player is moving or not moving.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)