is_action_just_released function not working

Godot Version

4

Question

Just starting out with godot.
Trying to make a dash system where the player needs to hold down the spacebar for a little before dashing, to charge up the dash. Tried using is_action_just_released in order to detect when the spacebar was released to cancel timer, but the timer doesn’t cancel when I release spacebar.
dash charge is the name of the timer

if Input.is_action_just_pressed(“ui_accept”):
$dash_charge.start()
if Input.is_action_just_released(“ui_accept”):
$dash_charge.stop()

Put this print(“Stopping Timer”) in your code and test if its print:

if Input.is_action_just_pressed(“ui_accept”):
    $dash_charge.start()
if Input.is_action_just_released(“ui_accept”):
    print("Stopping Timer")
    $dash_charge.stop()