This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Input Data

How to work with the GS_Unit input pipeline — reading player input, converting keyboard and joystick signals into movement vectors, and chaining input reactors.

The Input Data system is the pipeline that converts raw hardware signals into structured intent your movement code can consume. It sits between the active input profile and the mover stack, so controllers, movement components, and action systems all read from a single consistent source rather than polling hardware directly. Swapping input profiles at runtime — for remapping, controller switching, or accessibility options — requires no change to any downstream component.

For architecture details, component properties, and extending the system in C++, see the Framework API reference.

Input Reactor component in the O3DE Inspector

 

Contents


Pipeline Overview

Unit Input Handling Pattern Graph

Breakdown

The input pipeline has three stages. Each stage is a separate component on the unit entity, and they run in order every frame:

StageComponentWhat It Does
1 — ReadGS_PlayerControllerInputReaderComponentReads raw input events from the active input profile and writes them into GS_InputDataComponent.
2 — StoreGS_InputDataComponentHolds the current frame’s input state — button presses, axis values — as structured data.
3 — ReactThe Input Reactor componentClassifies the event’s phase and dispatches it to the reaction types in its profile, which produce intent.

All reactor components downstream of the store stage read from the same GS_InputDataComponent, so there is no duplicated hardware polling and no risk of two reactors seeing different input states for the same frame.


Input Data Component

GS_InputDataComponent is the shared state store. It does not read hardware — it only holds the values written by the Reader and consumed by Reactors.

Add it to any unit entity that needs to process input. A unit should have exactly one GS_InputDataComponent. All input reactors on the same entity read from it automatically.


Input Reader

GS_PlayerControllerInputReaderComponent connects the unit to the game’s active input profile. It receives input events from the profile and writes the resulting state into the unit’s GS_InputDataComponent each frame.

When the player controller possesses the unit, the reader activates. When the unit is depossessed or control is handed to an AI controller, the reader goes silent and the Input Data component retains its last-written state until overwritten.

Setup

Add GS_PlayerControllerInputReaderComponent to the unit entity alongside GS_InputDataComponent. No additional configuration is required — it picks up the active input profile automatically.

Script Canvas - Enabling and Disabling Input Groups

Input Groups handling nodes in the O3DE Script Canvas


Input Reactors

Reactors turn named input events into movement intent. They are a GS_Core mechanism — your unit carries an Input Reactor component holding a reactor profile asset, and the profile lists the reactions that unit has.

GS_Unit ships three reaction types:

Reactor typeWhat it does
KeyboardMovement_InputReactorFour directional events to movement. Releasing one direction while holding the opposite re-routes rather than stopping.
JoypadMovement_InputReactorTwo analog stick axes to movement, so how far you push is how fast you go.
Jump_InputReactorSets the jump state on press, clears it on release.

Each one has editable event name fields, which must match the event names in your input profile.

A typical player unit has all three in one profile. The keyboard and joypad reactors coexist happily — they listen to different events, so the unit responds to whichever device the player picks up, with no separate prefabs.


Adding Custom Reactors

To handle input the shipped reactors do not cover — sprinting, interaction, ability activation — you have two options.

For one-off behaviour, listen instead of extending. The reactor component emits every event it dispatches on a notification bus, so a ScriptCanvas graph or another component on the unit can respond to "Interact" without any C++ at all.

For a reusable reaction, write a reactor type. Derive from the reactor base, declare which event names you listen to and what to do when they fire, and reflect it. It then appears in the reactor profile’s type dropdown alongside the shipped ones — there is nothing to register.

For the extension guide, see Framework API: Input Reactors.


Quick Reference

NeedComponentNotes
Store input state on a unitGS_InputDataComponentRequired on every unit that processes input.
Read from active input profileGS_PlayerControllerInputReaderComponentActivates automatically when player controller possesses.
Keyboard → movement vectorKeyboardMovement_InputReactorComponentReads WASD / arrow keys from input data.
Joystick → movement vectorJoyAxisMovement_AxisReactorComponentReads axis pair, applies deadzone and scale.
Custom button or axis handlerExtend GS_InputReactorComponent (C++)Reads from GS_InputDataComponent same as built-ins.
Inspect movement vectorGS_InputDataComponent → GetMovementVectorVector3, current frame’s movement intent.

Glossary

TermMeaning
Input Data ComponentThe shared state store that holds the current frame’s input values for a unit
Input ReaderThe component that reads raw input events from the active input profile and writes them into the Input Data Component
Input ReactorA component that reads from the Input Data Component and produces intent values (movement vectors, action triggers)
Movement VectorA normalized 3D direction produced by input reactors and consumed by movers

For full definitions, see the Glossary.


See Also

For the full API, component properties, and C++ extension guide:

For related systems:


Get GS_Unit

GS_Unit — Explore this gem on the product page and add it to your project.