On key press do xy just once

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By blank
:warning: Old Version Published before Godot 3 was released.
	if (Input.action_press("key_left")):

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:

disable "autoshot" on keypress - Archive - Godot Forum

wf192 | 2016-10-20 23:48

:bust_in_silhouette: Reply From: ericdl

Monitoring for an event within func _input will work, as long as “key_left” if defined in your input map.

func _ready():

func _input(event):
	if event.is_action_pressed("key_left"): print("left key pressed")
:bust_in_silhouette: Reply From: eons

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.