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

Events vs Polling

Godot offers two ways to handle input: event-based (reacting when input happens) and polling (checking input state each frame).

Event-Based: _input()

Called once when the input occurs. Best for:

  • Button presses (jump, shoot, interact)
  • Menu navigation
  • Any "on press" action
gdscript
123456
func _input(event):
    if event.is_action_pressed("jump"):
        jump()
    
    if event.is_action_pressed("shoot"):
        fire_bullet()

Polling: Input singleton

Check 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 like Unity's OnButtonDown events, while Input.is_action_pressed() is like 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.