0
$\begingroup$

So, I'm trying to make a flappy bird -like game and I'm using the "character physics" to make the bird fly/jump but the limit is 225 jumps...

Any solution to exceed this limit?

I'm relatively new to bge

$\endgroup$
1
  • $\begingroup$ Can you provide a screenshot of your character logic? $\endgroup$
    – VorTechnix
    Commented Jul 20, 2018 at 22:34

1 Answer 1

0
$\begingroup$

There is no easy way to do this. Even though there is a jumpCount property you can not edit it via script as it's readable only. However, after some tests I found a hacky workaround that might do it for you, because resetting the gravity seems to reset the jumpCounter. It can by achieved by this procedure:

Paste this script into the text editor.

import bge

def main():
    cont = bge.logic.getCurrentController()
    own = cont.owner
    hero = bge.constraints.getCharacter(own)
    hero.jump()

    # Reset the gravity:
    hero.gravity = 0
    hero.gravity = 30 #default value. You might change this :)
main()

Then use the following setup on your player to trigger the script. Notice that the jumping is also done via the script. logic setup

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .