# 6. Pitfalls Part of [[Input System]]. Previous: [[5. Worked Example Remappable Player]]. > [!warning] Verification status > Domain reload and device-loss behaviors cite Input System **1.20.1** docs. Dual-backend and PlayerInput copy issues are long-standing package behaviors documented in workflows; still **not** re-validated in a fresh 6000.5 project for this writing. ## 6.1 Domain reload resets device state Docs: [Devices and domain reloads](https://docs.unity3d.com/Packages/[email protected]/manual/devices-domain-reloads.html). On script recompile or Enter Play Mode **with** domain reload, the Input System reinitializes. Devices are recreated but **reset to default state**. Layout registrations must re-run (`[InitializeOnLoad]` / runtime init). **Configurable Enter Play Mode** without domain reload is supported in **Input System 1.20.0+**, but do not keep stale `InputUser` or device references across the boundary — re-pair after entering Play Mode. Practical teaching habit: load binding overrides in `Awake`, and never assume `Gamepad.current` identity survived a reload. ## 6.2 Dual input (Active Input Handling = Both) **Both** is a migration bridge, not a destination. Symptoms: - Old `Input.GetAxis("Horizontal")` and new Move action both run → double speed. - UI modules fight (Standalone vs Input System UI). - Conditional code compiled with both `ENABLE_INPUT_SYSTEM` and `ENABLE_LEGACY_INPUT_MANAGER` hides unfinished migrations. Finish the cutover, set **Input System Package (New)**, delete legacy `Input` calls. The upgrade note [[Unity New Input System Upgrade Tutorial]] is the short path for the walker project. ## 6.3 Lost / disconnected devices Docs: [Handle loss of a device](https://docs.unity3d.com/Packages/[email protected]/manual/handle-loss-of-device.html). Paired devices that disconnect stay tracked by `InputUser` and re-pair on return. Subscribe to `InputUser.onChange` for UI ("Reconnect controller"). ```csharp using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Users; public sealed class DeviceLossWatcher : MonoBehaviour { void OnEnable() => InputUser.onChange += OnUserChange; void OnDisable() => InputUser.onChange -= OnUserChange; void OnUserChange(InputUser user, InputUserChange change, InputDevice device) { if (change == InputUserChange.DeviceLost) Debug.LogWarning(quot;Device lost: {device}"); else if (change == InputUserChange.DeviceRegained) Debug.Log(quot;Device regained: {device}"); } } ``` Also handle **never connected**: `Gamepad.current == null` when you assumed a pad scheme — either fall back to Keyboard&Mouse or show a "press A to join" prompt via `PlayerInputManager`. ## 6.4 Enabling maps twice / leaking enables - Generated class: you `new` an asset instance — enabling it does not enable `PlayerInput`'s copy. - `PlayerInput` already enables its default map — also calling `Enable()` on a second instance → duplicate callbacks if you subscribed to both. - Components that `Enable()` an `InputActionReference` in `OnEnable` and forget who owns Disable cause "Interact works in menus" bugs. **Own enables in one director.** Everyone else only subscribes. ## 6.5 PlayerInput filtered copies When using `PlayerInput`, read **`playerInput.actions`**, not `InputSystem.actions` and not a separate `new MyActions()`. Device filtering for local multiplayer depends on that copy (workflow docs). Breaking it is a classic "player 2 steers player 1" bug. ## 6.6 Rebind memory leaks and stuck disables `RebindingOperation` must be **Disposed**. Cancel paths must **re-enable** the action. Missing either produces native leaks or a Jump that never works again until domain reload. ## 6.7 Composite vs scheme assignment Schemes must be ticked on composite **parts**. Assigning only the parent composite often leaves WASD unexpectedly active in Gamepad scheme filters. ## 6.8 PassThrough vs Button for XR UI poses Tracked position/orientation actions for UI **must** be PassThrough or one controller's pose wins conflict resolution and the other hand's ray dies — [tracked UI docs](https://docs.unity3d.com/Packages/[email protected]/manual/supported-ui-input-types-tracked.html). ## 6.9 Two UI input modules XRI's `XRUIInputModule` is incompatible with leaving `InputSystemUIInputModule` / Standalone enabled on the same EventSystem. Quest scenes: one module only ([[Meta Quest 2]], [[8.UI Toolkit for VR]]). ## 6.10 Mouse look + rebinding UI If Cursor is locked and you open a rebind overlay, unlock/show cursor and disable Player Look for that moment or the first click both rebinds and yaws the camera. ## 6.11 Netcode ownership Input System does not replicate. With [[Multiplayer with Netcode for GameObjects]], only the owning client should enable gameplay maps that drive that pawn. Hosting a listen-server with unbound clients enabling Keyboard Move will move the host pawn locally in confusing ways. ## 6.12 Quick diagnosis checklist 1. Active Input Handling value? 2. Is the `.inputed` saved? 3. Is the correct map enabled? Any second asset instance? 4. Binding actually assigned to the active control scheme? 5. UI module matching your stack? 6. For rebinds: overrides loaded after asset construct, operation disposed? 7. For Quest: are you on the LTS line required by [[Meta Quest 2]] notes? Back to hub: [[Input System]].