Godot Version
4.5.1
Question
I am trying to implement a double tap then hold feature but only the last nested if statement isn't working for some reason despite the values showing to be true when debugging yet the elif statement runs perfectly fine
Please bear with me, I am pretty bad at programming and I feel this may not even be a good way to handle this feature
_portal_state_setter(delta)
runs match cases for the respective enum PlayerPortalState values (TAP, IDLE, HOLD
if not is_grounded:
if player_jumped == true:
if Input.is_action_pressed("jump"):
Input.action_release("jump")
if Input.is_action_just_released("jump"):
player_second_tap = true
player_current_state = PlayerPortalState.TAP
print("jump released")
if Input.is_action_pressed("jump") and player_second_tap == true:
print("activating...")
air_time += delta
if air_time > 0.15:
player_current_state = PlayerPortalState.HOLD
print("val set to on from elif")
#elif player_jumped == false:
#if Input.is_action_pressed("jump"):
#air_time += delta
#if air_time > 0.15:
#player_current_state = PlayerPortalState.HOLD
#print("val set to on from playjump false")
_portal_state_setter(delta)