How would I go for


(Oli) #1

Hi! I wonder would anyone know how to do sensitive jump in a platformer. I allready got my guy to jump i just need to add something like:

if (Input.pressed(Key.SPACE)) //for 0.3 second, do function small jump

if (Input.pressed(Key.SPACE)) //for 0.5 second, do function medium jump

if (Input.pressed(Key.SPACE)) //for 1 second, do function big jump

thx


(Ultima2876) #2

Use Input.check rather than Input.pressed - that way, if they hold the key for more than 1 frame it will increase the jump height more. But make sure you limit it otherwise your jump will quickly turn into a ‘fly’ :slight_smile:


(reopucino) #3

i always use this

in update player

if(input.check("JUMP")
    {
        spdY = -5;
        }

in gravity

 if (spdY < 0 && !Input.check("JUMP"))
    {
    gravity+=1
    }

(Oli) #4

Thx bros I got it working Now:)