One-time action
Input Guide
Use Input Map actions and event checks so controls survive remapping and ports.
Godot input model
Input System Guide
Learn where Godot separates input events, held-state polling, and action mapping when you are coming from Unity.
Mental model
Held movement
Input.get_vector()
Use this inside physics updates when direction must stay responsive every frame.Device mapping
Input Map
Name the action once, then bind keyboard, mouse, and gamepad without rewriting code.First choice
Events vs Polling
Godot gives you two clean paths: react to an input event when it happens, or poll the current input state each frame. Most games use both.
Event-based: _input()
Called once when the input occurs. Best for:
- Button presses such as jump, shoot, interact
- Menu navigation and confirm/cancel actions
- Any action where the press should fire once
func _input(event):
if event.is_action_pressed("jump"):
jump()
if event.is_action_pressed("shoot"):
fire_bullet()Polling: Input singleton
Checked every frame. Best for:
- Continuous movement
- Held buttons
- Analog stick input
func _physics_process(delta):
if Input.is_action_pressed("move_right"):
position.x += speed * delta
if Input.is_action_pressed("sprint"):
speed = sprint_speed_input() is closest to button-down style
events, while Input.is_action_pressed() feels
closer to Input.GetKey().
Lock the pattern in
Before jumping to the next page, turn the idea into one tiny scene or script. That is where the Godot habit sticks.
Avoid hardcoded KeyCode-style habits for anything player-facing.
Think of actions as named gameplay intent, not raw buttons.
Read actions with Input methods and keep movement in physics ticks.
Create actions for move, jump, attack, pause, and interact before writing controller code.