Periodic shooting
From CPC Game Making
var waiting_to_shoot = false
func _input(event: InputEvent) -> void:
if event.is_action("ui_right") and waiting_to_shoot == false:
waiting_to_shoot = true
await get_tree().create_timer(0.4).timeout
print('A shot was fired!')
waiting_to_shoot = false