Input¶
Unity Input System 1.14.0. The asset is Assets/InputSystem_Actions.inputactions — the
Unity 6 template default, unmodified so far.
Two input paths coexist
Most of the project reads the new Input System through InputActionReference fields. The
dialogue system polls legacy Input.GetKeyDown for Space / E / F and the left mouse
button (DialogueManager.Update), bypassing the Input System entirely. That needs to be
reconciled — see wave 1.
Action maps¶
Player¶
| Action | Type | Keyboard & mouse | Gamepad |
|---|---|---|---|
Move |
Value, Vector2 | WASD / arrows | Left stick, D-pad |
Look |
Value, Vector2 | Pointer delta | Right stick |
Attack |
Button | Left mouse, Enter | West button |
Interact |
Button | E | North button |
Crouch |
Button | C | East button |
Jump |
Button | Space | South button |
Sprint |
Button | Left Shift | Left stick press |
Previous |
Button | 1 | D-pad left |
Next |
Button | 2 | D-pad right |
Touch, joystick and XR bindings are present on most actions, inherited from the template.
UI¶
The standard template map: Navigate, Submit, Cancel, Point, Click, RightClick,
MiddleClick, ScrollWheel, TrackedDevicePosition, TrackedDeviceOrientation. Consumed by
the InputSystemUIInputModule.
Control schemes¶
Keyboard&Mouse, Gamepad, Touch, Joystick, XR.
How actions reach components¶
There is no generated C# wrapper class and no PlayerInput component doing message dispatch.
Every consumer takes a serialised InputActionReference and reads it directly:
| Component | Field | Action |
|---|---|---|
HelloMarioFramework.Player |
jumpAction, crouchAction, movementAction |
Jump, Crouch, Move |
HelloMarioFramework.FreeLookHelper |
cameraAction, zoomAction, centerAction |
third-person camera control |
FirstPersonLook |
lookAction |
Look |
HoseWaterJet |
sprayAction |
spray trigger |
This means assignment is per-scene wiring, not code. A component with an unassigned
InputActionReference silently does nothing, which is a common cause of "the hose does not
fire".
Notes for anyone touching input¶
Enable your actions. Nothing enables the maps globally. FirstPersonLook enables its action
in OnEnable; HoseWaterJet re-enables its action every frame in LateUpdate, because
menus and scene loads can disable it out from under the component. Copy the latter pattern for
anything that must not stop working after a menu.
One action, two devices. Look carries both a per-frame mouse pixel delta and a stick axis
in the same Vector2, and they need entirely different scaling. FirstPersonLook handles this by
inspecting action.activeControl to see which device last moved and switching between
mouseSensitivity (degrees per unit) and stickSensitivity (degrees per second). Any new
look-like action needs the same treatment.
No spray action exists in the asset yet. HoseWaterJet.sprayAction is expected to be bound
to Attack, or to a new Spray action added to the Player map. Until then the
sprayWithoutInput debug toggle drives it.
Planned additions¶
- A dedicated
Sprayaction, soAttackstays free for whatever combat needs later. - Dialogue advance / choice actions, replacing the legacy
Input.GetKeyDownpolling inDialogueManager. - Action-map switching: a
Dialoguemap that disables Player while a conversation is open, so the boy does not walk off mid-sentence.