Godot Version
4.2.2 stable
Question
What I want to achieve is, when the player jumps I want to change its horizontal move_speed, and when the player hits the ground, the horizontal speed will be changed back to a default value.
The question is that, when I do this:
velocity.y = -100
print("JUMP")
move_and_slide()
if is_on_floor():
print("Hit the ground!!")
The output is always like this:
JUMP
Hit the ground!!!
The problem is the moment when a character takes off, the output if ‘is_on_floor’ is still true.
Thus, my horizontal speed will be changed back to default values immediately…
Thanks for reading my question, I’ll be extremely appreciated if you can help me.