Verify an Enhanced Input action headlessly in a packaged Linux game
Section titled “Verify an Enhanced Input action headlessly in a packaged Linux game”- Status: Current.
- Engine: ue6-main
61e2877e1, Linux x86_64, Epic clang 23.1.5 (v27 SDK). - Context: Standalone UE6 C++ game. The example also calls a BPVerse actor in a separate interaction check.
- Prerequisites: Enhanced Input enabled, a possessed character, and a Linux Development build. The command examples use Coop Zero and the build wrapper
$WRAP, with$Pset to the project root (README).
Symptom
Section titled “Symptom”A headless build can load and run while giving no evidence that a Move action reaches the character. Earlier Coop Zero runs also logged [AppendTagsToInputMode] Null player input.
Smallest example / reproduction
Section titled “Smallest example / reproduction”Set the default classes under [/Script/Engine.InputSettings] in DefaultInput.ini.
DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInputDefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponentIn the local controller’s SetupInputComponent, call the superclass, then create a UInputMappingContext and an Axis2D UInputAction with NewObject. Keep both reachable through reflected properties. Map EKeys::Gamepad_Left2D to the action and bind ETriggerEvent::Triggered on the UEnhancedInputComponent. Add the mapping context to UEnhancedInputLocalPlayerSubsystem after the controller has its player input. In the handler, read the FVector2D and pass it to the possessed character’s normal movement function.
For a diagnostic command, call StartContinuousInputInjectionForAction(MoveAction, FInputActionValue(Stick), {}, {}) on that same local player subsystem. At the end of a one-shot world timer, call StopContinuousInputInjectionForAction(MoveAction) and log the original and current locations of the same pawn. Use the exact action instance that the controller bound. Remove the mapping and stop any active injection when the controller ends play.
Solution
Section titled “Solution”Running the probe.
"$WRAP" step03-packaged-move timeout -k 15s 60s "$P/Out/Linux/CoopZero.sh" \ -nullrhi -nosound -unattended -stdout \ '-ExecCmds=coop.botmove 1 0 2,delay 3 coop.interact,delay 4 quit' \ -abslog="$P/Saved/step03-packaged-move.log"Start on a floor so the log distinguishes walking from falling. Check that the horizontal coordinates change. In this run, the delayed interaction also checks that the nearby probe is out of range after the move.
For an exact single startup command, keep -ExecCmds=coop.interact and pass a separate -Exec script containing delay 1 quit. On this revision ULocalPlayer::ExecMacro prepends ../../Binaries/ to file paths without Binaries in the name. An absolute path under the project’s ignored Binaries directory works. The log-triggered -testexit=VERSE_INTERACT_OK alternative logged the expected marker and returned 1 on Linux after FUnixPlatformMisc::RequestExit(1, FEngineLoop::Tick.GScopedTestExit).
mkdir -p "$P/Binaries/Step03"printf '%s\n' 'delay 1 quit' > "$P/Binaries/Step03/quit.exec""$WRAP" step03-packaged-interact timeout -k 15s 60s "$P/Out/Linux/CoopZero.sh" \ -nullrhi -nosound -unattended -stdout -Exec="$P/Binaries/Step03/quit.exec" \ -ExecCmds="coop.interact" -abslog="$P/Saved/step03-packaged-interact.log"Why it works
Section titled “Why it works”The local player subsystem feeds continuous injections through Enhanced Input on successive ticks. By using the bound action instance, the probe exercises action evaluation, the controller binding and character movement. Injecting an action goes downstream of physical key mapping and its dead zone.
Linux ApplicationCore.Build.cs links SDL3 for the Linux platform group. LinuxPlatformApplicationMisc.cpp initializes the gamepad subsystem by default. LinuxApplication.cpp translates SDL’s left stick and south, west and north face buttons into Unreal’s gamepad keys. In InputCoreTypes.cpp, Gamepad_Left2D pairs the left X and Y axes. Standard SDL-recognized controllers require no extra Unreal gamepad plugin. The Enhanced Input project settings above select Unreal’s action system.
Verified
Section titled “Verified”- Evidence level: runs in editor and runs in packaged build.
- How:
- Runs in editor:
step03-editor-movethroughUnrealEditor-Cmd -game -nullrhiloggedMOVE from=V(Z=90.15) to=V(Y=583.97, Z=90.15)atSaved/step03-editor-move.log:2140.step03-editor-interact-cleanused the exact-ExecCmds="coop.interact"with the exit script and loggedINTERACT probefollowed byVERSE_INTERACT_OKat lines 2139–2140 of its log. - Runs in packaged build: The packaged movement command above logged
MOVE from=V(Z=90.15) to=V(Y=578.18, Z=90.15)atSaved/step03-packaged-move.log:1054. The packaged interaction command loggedINTERACT probefollowed byVERSE_INTERACT_OKatSaved/step03-packaged-interact.log:1052and:1053. Both exited 0. - The post-move interaction fired and produced zero hits in both environments. The earlier
Null player inputdiagnostic was absent in these launches. The CommonUI viewport-client diagnostic persisted.
- Runs in editor:
- Date / by: 2026-11-25, Coop Zero Step 03.
Limits and assumptions
Section titled “Limits and assumptions”The stick and buttons on a physical controller, rendered camera behavior, and gameplay feel need hands-on play. The SDL statements are source inspection. Frame rate and fixed-step behavior can change the wall time of a world timer.