Core Systems Quest

Input Guide

Use Input Map actions and event checks so controls survive remapping and ports.

10-20 min Practice first Godot 4.6

Godot input model

Input System Guide

Learn where Godot separates input events, held-state polling, and action mapping when you are coming from Unity.

Open live playground Use the tabs below as a reference sheet.

Mental model

01 Player presses a device input
02 Input Map translates it into an action name
03 Your script reads the event or current state

One-time action

_input(event)

Use this when the press itself matters: jump, shoot, interact, confirm, pause.

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
gdscript
123456
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
gdscript
123456
func _physics_process(delta):
    if Input.is_action_pressed("move_right"):
        position.x += speed * delta

    if Input.is_action_pressed("sprint"):
        speed = sprint_speed
Unity comparison

_input() is closest to button-down style events, while Input.is_action_pressed() feels closer to Input.GetKey().

Tutor Checkpoint

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.

Unity habit

Avoid hardcoded KeyCode-style habits for anything player-facing.

Unreal habit

Think of actions as named gameplay intent, not raw buttons.

Godot habit

Read actions with Input methods and keep movement in physics ticks.

Try this

Create actions for move, jump, attack, pause, and interact before writing controller code.