Skip to content

Device Lost, Drop Out and Rejoin

Reserved controller replacement during a session

Same-instance InputUser.DeviceLost / DeviceRegained preserves the user, session, context, binding and representation. Gamepad/joystick services follow the regained owned device, including a replacement instance with the same runtime ID.

For a genuinely new device ID, Unity does not generate DeviceRegained by matching hardware descriptions. The framework can reclaim the existing user's reserved seat:

  • Automatic reclaim requires one unavailable owner with the exact same nonempty product, layout and full device description, including a nonempty serial unique among the known controller owners.
  • Without a serial, pressing the normal Join action can explicitly reclaim exactly one matching reserved seat. This is seat-reclaim intent, not proof of physical identity.
  • The incoming device must have appeared after loss; controllers already registered when the loss occurred keep their ordinary Join semantics.
  • Multiple matching reserved seats are ambiguous: reclaim and duplicate Join are rejected. Reconnect the original instances, or intentionally end those sessions.
  • Differing or missing hardware descriptions are not guessed. Display-name suffixes and deviceId are never persistent identities. No cross-launch identity is claimed.

Reclaim clears only the existing user's obsolete lost pairing and pairs its replacement through InputUser. It does not create another session, user or gameplay object. Device Disabled/Enabled also updates controller availability; both shared keyboard roles report availability from their existing user's live paired keyboard.

Optional gameplay Drop Out and Rejoin

MultiplayerCoordinator.TryLeave(sessionId) remains a permanent Leave: it removes the session, releases its input slot, InputUser and scene binding, and allows the lowest available PlayerIndex to be reused. A gameplay scene can opt into reversible owned Leave actions by setting coordinator.DropOutOnLeave = true for that scene's lifetime and restoring false on teardown. The shared keyboard, gamepad and joystick services then route their owned Leave callbacks through TryHandleLeaveRequest.

Drop Out keeps the PlayerSession, InputSlot, PlayerIndex, selected character and input role/profile reservation. PlayerSession.IsDroppedOut and GameplayPlayerContext.IsDroppedOut distinguish it from DeviceLost; IsInputAvailable returns false for dropped-out gameplay. PlayerDroppedOut / PlayerRejoined events also reach GameplayPlayerContexts. GameplayPlayerSetup releases its scene binding on Drop Out and resolves the selected character again on rejoin. It does not choose a sample respawn point or preserve a game's score; those are scene-owned decisions. The matching input service accepts the normal Join control for the exact still-owned keyboard role or connected controller instance and calls TryRejoin without creating a new PlayerSession or InputUser. Device replacement still follows the conservative metadata-based reclaim policy above; ambiguous hardware is not guessed. An automatic DeviceRegained does not itself reactivate a voluntarily dropped-out participant.

TryDropOut and TryRejoin are explicit APIs for integrations that have validated the relevant input source. An explicit TryLeave remains permanent even while the opt-in owned-action policy is enabled. Main Menu shutdown uses permanent Leave. The opt-in flag is scene policy; customers should set it only where their gameplay represents dropped-out players and reset it when that scene ends.