codeAPI Reference

s&box ClientInput: Input scope for controlled objects

calendar_today May 12, 2026 schedule ~1 min read person PatrickJr verified 50

Client input scope struct for routing input to controlled objects. Used by ControlSystem to redirect player input during chair/vehicle control.

Static Properties

CSHARP
/// The player currently running an IPlayerControllable.OnControl tick,
/// or null when not inside a control scope (e.g. during regular player input).
public static Player Current => _currentState.player;

Properties

CSHARP
public readonly bool IsEnabled => !string.IsNullOrWhiteSpace( Action );
public string Action { get; set; }

Methods

CSHARP
/// Returns an analog value between 0 and 1 representing how much the input is pressed.
public readonly float GetAnalog()

/// Returns true if button is currently held down.
public readonly bool Down()

/// Returns true if button was released.
public readonly bool Released()

/// Returns true if button was pressed.
public readonly bool Pressed()

/// Push a new control scope for a player. Returns IDisposable to restore previous scope.
internal static IDisposable PushScope( Player player )

Usage

Use ClientInput.PushScope( player ) to redirect input to a specific player. Inside the scope, ClientInput methods (Down, Pressed, etc.) read from that player's connection instead of the local player.

Example: ControlSystem calls PushScope( seatedPlayer ) before calling IPlayerControllable.OnControl(), so the controllable reads the seated player's input.

Source

Used by ControlSystem for chair and vehicle input routing.

Was this helpful?