/godot-dev:godot-inputfrom godot-dev
Guides on Godot input: InputMap actions, gamepad/touch, mouse aim, rebinding saved at runtime, and diagnosing missed/doubled jumps.
Ships in godot-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Gameplay reads actions; a gamepad, a touch overlay and a journey's scripted driver all fill the same ones.
| Situation | Read |
|---|---|
| "The jump is missed sometimes", "it jumps twice", "it only fails at high frame rates" | Missed or doubled jumps below |
Adding actions: project.godot text, InputMap at runtime, ui_*, deadzones, several pads | reference/actions.md |
| A struct the motor reads; a jump buffer; scripted input for an AI or a journey | One reader below, resources/input_reader.gd |
| Mouse look and mouse aim | reference/actions.md → "Mouse" |
| Phone play: an on-screen stick, touch buttons, several fingers | reference/touch.md, resources/virtual_stick.gd |
"Press a key to rebind", conflicts, saving to user://, reset to defaults | reference/rebinding.md, resources/rebind_store.gd |
| A typo in an action name; an action nothing can press | scripts/input_check.py |
What the engine does with injected events, at --fixed-fps 30, 60 and 120 against the default
60 physics ticks:
Input.is_action_just_pressed read in _physics_process is true in exactly one tick per
press: not twice when a frame holds two ticks, not lost when a frame holds none. Read in
_process it is true in exactly one frame.just_pressed (and
just_released) once, while Input.is_action_pressed is never true for it.Input.parse_input_event is buffered: the action changes at the next frame's flush.
Input.action_press changes it at once and calls no _input.just_pressed does not fire
again; InputEvent.is_action_pressed ignores echoes unless allow_echo is true.So a missed or doubled jump is the game's code. Six presses (four taps, one tap shorter than a frame, one long hold) give these jump counts per pattern:
| How the jump is read | 30 fps | 60 fps | 120 fps |
|---|---|---|---|
is_action_just_pressed polled in _physics_process | 6 | 6 | 6 |
input_reader.gd: consume_jump() in _physics_process | 6 | 6 | 6 |
_process sets want = is_action_just_pressed(...), the tick jumps on want | 12 | 6 | 4 |
the same, the tick clears want after jumping | 6 | 6 | 4 |
_unhandled_input jumps on the event and the tick polls | 12 | 12 | 12 |
is_action_pressed and on the floor | the short tap: 0; the hold: jumps again on every landing |
The causes, in the order to suspect them:
_input or _unhandled_input handler and a poll both act on one press.
One place reads the jump.want = want or ...) and clear it in the tick.is_action_pressed misses the short tap and re-jumps while held.just_pressed and is_on_floor() drops it; a
buffer (0.12 s in the reader) keeps it until the body lands.velocity after the jump in the same tick: a second writer
(godot-2d-controller, godot-3d-controller own the motor).resources/input_reader.gd is a Node under the player. It samples the InputMap in
_physics_process at process_physics_priority = -100, so it runs before the motor in the same
tick, and exposes move (Input.get_vector, length ≤ 1), jump_held, look (captured mouse
motion this tick, radians) and last_device. The motor calls consume_jump() once per tick.
const InputReader = preload("res://input/input_reader.gd")
@onready var input: InputReader = $InputReader
func _physics_process(delta: float) -> void:
if is_on_floor() and input.consume_jump():
velocity.y = jump_velocity
velocity.x = input.move.x * run_speed
move_and_slide()
A journey or an AI sets from_device = false and calls drive(move, jump_down) each tick before
the motor; a rising edge of jump_down buffers a press exactly as a device does. A journey that
drives the real InputMap instead presses actions: godot-play-harness.
The reader checks its five action names in _ready and fails loudly (ERROR:) if one is
missing, instead of reading nothing for the rest of the run.
jump, dash, move_left), never after a key. Built-in ui_*
actions exist in every project and drive Control focus; give gameplay its own.project.godot ([input], one Object(InputEvent...) per event) or at
runtime with InputMap.add_action and InputMap.action_add_event. A
ProjectSettings.set_setting("input/...") alone does not register an action;
InputMap.load_from_project_settings does, and it drops every action added at runtime.InputEventKey.physical_keycode: the key's place on a US QWERTY board, which
keeps WASD where the fingers are on other layouts. Show its label with
DisplayServer.keyboard_get_label_from_physical.device -1 matches every pad; one with 0 matches only pad 0, which is how a
second local player gets their own actions. Stick strength is rescaled past the deadzone:
with 0.2, a stick at 0.3 reads 0.125 (Input.get_action_raw_strength still says 0.3).The project.godot text, per-player actions, deadzones and mouse aim: reference/actions.md.
python3 scripts/input_check.py /path/to/project # FAIL per undefined name, exit 2
python3 scripts/input_check.py /path/to/project --strict # actions with no event fail too
It reads project.godot, InputMap.add_action calls and every literal action name in .gd,
.tscn and .tres files (Input, InputMap and InputEvent calls, get_axis,
get_vector, action = "..." on a TouchScreenButton, var action_* = &"..." defaults) and
fails on a name no InputMap defines, with the nearest real name. The engine only reports a bad
name when the line runs (ERROR: The InputMap action "jmup" doesn't exist.), so a typo in a rare
branch survives every load check. Names built at runtime are counted as dynamic and not checked.
input_check.py --selftest runs the lint on fixtures, then this skill's resources in a temp
project headless: the timing table above, the buffer, drive(), mouse look, pad devices,
deadzones, echoes, the virtual stick and a rebinding saved in one process and loaded in the next.
Input directly. It reads the reader, so a device, a touch overlay
and a script are interchangeable and the motor is testable._physics_process; anything visual (camera look, UI) may read per frame.jump, pausing must stop the
player reading it (godot-scene-flow owns pause).godot-verify — and with input_check.py when an action name moved.godot-cameragodot-2d-controller · godot-3d-controllergodot-uigodot-play-harnessgodot-scene-flowreference/actions.md (opens in a new tab)reference/rebinding.md (opens in a new tab)reference/touch.md (opens in a new tab)resources/input_reader.gd (opens in a new tab)resources/rebind_store.gd (opens in a new tab)resources/virtual_stick.gd (opens in a new tab)scripts/input_check.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub tipoli5890/game-studio --plugin godot-dev28 skills in this plugin
/godot-2d-controllerMove a 2D character in Godot: CharacterBody2D jump, coyote time, jump buffer, slopes, one-way and moving platforms, top-down movement./godot-2d-renderingGodot 2D look: draw order, z_index and y-sort, CanvasLayer, 2D lights and shadows, canvas shaders, Parallax2D, pixel-perfect scaling./godot-2d-rigA layered 2D character into Godot: rig2d.json to Skeleton2D, Bone2D and weighted Polygon2D parts, cut-out animation, 2D IK.