how can i reverse "is_on_floor"

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Ktotoetoia

i making 2d game,it has gravity reverse,i use *= -1 to all gravity var,but function is_on_floor
dont reverse, how can i fix this

Did you change the ‘Up’ direction in move_and_slide? godot won’t magically think something the ceiling is now the floor unless you tell it which way is up. Note there’s also an is_on_ceiling.

spaceyjase | 2021-12-13 10:01

thanks i forgot about move_and_slide

Ktotoetoia | 2021-12-13 10:37

:bust_in_silhouette: Reply From: lewis glasgow

in your move and slide do move_and_slide(vel, Vector2.DOWN) vector2.DOWN is equal to (0,-1) which means the celling will now be classed as the floor