How to stop my character from flying once he reaches a certain point in the sky

Godot Version 4.1

Making a 2D platformer and want the character to fly until he reaches some point in the sky like -100y for instance.

I feel like the simplest answer here would be to make it so the player can only fly if their y coordinate is above -100.

idk tho im bad at coding :P

just cap the player global position or position to that height every time (in _physics_process) it moves, can use min() or clamp() the position
if it’s a rigidbody2d, then it will be more complicated

or really just put a collider that stretch horizontally at height -100, since the player should have collider, it wont be able to go through it