I'm creating a state machine for my player with the current states atm:
All the states works fine, but now I want to implement a double jump, so my question is:
do I need to apply the "jump force" again before or after the moveandslide?
velocity = move_and_slide(velocity, Vector2.UP)
If Input.is_action_just_pressed("jump") and jumps < 1:
jumps += 1
Here's the init_jump:
anim = ""
state = states.JUMP
velocity.y = jump_speed # -300