in fixed process does nothing, is there a way to execute the if statement only on the key press and not execute it over and over while being pressed?
This is a similar question, and a similar answer:
Monitoring for an event within func _input will work, as long as "key_left" if defined in your input map.
if event.is_action_pressed("key_left"): print("left key pressed")
I use this utility:
The development version has Input.is_action_just_pressed and Input.is_action_just_released if you don't care to work with non stable version.