CMCharacter Modules 0.1.0

Input System Command Source

Kind: Command source · Add Component: Character Modules > Input > Input System Command Source

Turns keys and sticks into commands. A bot, a replay or a test can play exactly as a player does.

Turns the player's keys and sticks into a command: where to move, where to look, which buttons are held. The character only ever reads commands, so a bot, a replay or a test can drive it exactly as a player does.

Inspector
▼Input System Command Source⋮
CharacterCharacter (Character Motor)
ActionsNone
Mouse Sensitivity0.1
Stick Turn Speed180
Invert PitchOff ▾
Lock CursorOn ▾
The Input System Command Source component in the Inspector, with its defaults.
Origin. Quake's usercmd_t (1996): the client sends a small command each frame, and the movement code runs on it.

How it works

Builds commands from the Input System. Look is sampled every rendered frame; button presses are remembered until the next simulation step reads them, so a quick tap is never lost between steps.

With no actions asset assigned it uses built-in bindings: WASD or left stick to move, mouse or right stick to look, Space or the south button to jump, Left Ctrl or the east button to crouch, Left Shift or a left stick press to sprint, the left mouse button, E or the west or north button for the action, Q or the east button to dodge (the east button also crouches: no preset has both yet), Tab, the middle mouse button or a right stick press to lock on. Esc frees the mouse and captures it again.

Combine it

  • Used by the presets: Arena Shooter, Competitive Shooter, Surf, Retro Platformer, Modern Platformer, Traversal Adventure, Action RPG.

Properties

PropertyDescriptionRangeDefault
CharacterThe character this source drives. Drag its Character Motor here.None
ActionsOptional actions asset with a 'Player' map: Move, Look, LookStick, Jump, Crouch, Sprint, Walk, Action. Empty: built-in keyboard, mouse and gamepad bindings.None
Mouse SensitivityDegrees turned per mouse count.0 or more0.1
Stick Turn SpeedDegrees per second at full right stick.0 or more180
Invert PitchMouse up looks down.Off
Lock CursorCapture the mouse on start. Esc frees it and captures it again.On

Additional resources