Detect if the player is in the air?

zcrudehydro

Member
Modder
Jun 27, 2024
4
0
230
Pronouns
he/him
I wish to know how to detect if the player is currently in the air, or touching the ground, as I am attempting to give Luigi a much higher jump when their action is equal to either ACT_JUMP, ACT_DOUBLE_JUMP or ACT_TRIPLE_JUMP and adding velocity, however this results in the velocity CONSTANTLY increasing in the air when jumping, so instead I have opted for simply doing the velocity increase whenever the A button is pressed on the ground, however I do not know how to detect if you are actually on the ground.
 
Solution
if m.action & ACT_FLAG_AIR ~= 0


this results in the velocity CONSTANTLY increasing in the air when jumping
Increasing vel in the HOOK_BEFORE_PHYS_STEP hook should work fine, however these actions break when doing so:

Code:
ACT_TWIRLING
ACT_GETTING_BLOWN
ACT_FLYING_TRIPLE_JUMP
ACT_SHOT_FROM_CANNON
ACT_LAVA_BOOST

Users who are viewing this thread