How to check if a player is not hitting a platform

I’m trying to make a platformer game, but I don’t want the player to be able to jump mid-air and I don’t know how to fix it. Could somebody help?

Here is the file :My Project3-31-2023_9-10-42.wick (2.4 KB)

My Project3-31-2023_12-53-44.wick (2.4 KB)

Fixed it

The main problem was the ordering of the scripts, which is why I usually just use isKeyJustPressed() or isKeyDown() in the Update script instead of using the keyDown script

I don’t know what you fixed, but I can still jump mid-air on that file.

add this to the update script

if(!OnGround){
    CanJump=false;
}

I don’t remember the variable names so just change the names i guess

I can still jump mid-air. Did I do something wrong? I’m on version 1.19.3 if that helps.

File: My Project3-31-2023_15-00-58.wick (2.4 KB)

noJumpInMidAir.wick (2.6 KB)
Here is a fixed version where you can’t jump mid air.

1 Like

Thank you so much!

Yeah no problem!