Skip to content

API Interface InputDef

github-actions[bot] edited this page Nov 24, 2026 · 1 revision

Interface: InputDef<S>

Defined in: src/engine/net/messages.ts:88

A per-tick input stream (Unity's IInputComponentData). Clients write their input each fixed tick; the server reads each connection's input for the tick it's simulating.

Type Parameters

S

S extends Schema = Schema

Properties

id

readonly id: string;

Defined in: src/engine/net/messages.ts:89


local

readonly local: DataView<S>;

Defined in: src/engine/net/messages.ts:95

Client: this tick's input, writable (write it in fixedUpdate). Fields not written keep last tick's values. Throws in a server World.


schema

readonly schema: S;

Defined in: src/engine/net/messages.ts:90

Methods

localOf()

localOf(player): DataView<S>;

Defined in: src/engine/net/messages.ts:97

Client: local player player's input this tick, writable, as local is player 0's. Throws in a server World.

Parameters

player

number

Returns

DataView<S>


of()

of(node, player?): Readonly<DataView<S>> | null;

Defined in: src/engine/net/messages.ts:111

Server: the input from node's connection for the current server tick, or null before any arrived. If this tick's is missing, the newest earlier one. Client: its own input, for its connection node. node is a connection node; nodes owned by a connection will work too (replication, T11). player picks the client's local player (default 0). Null in Worlds that aren't networked.

Parameters

node

GameObject

player?

number

Returns

Readonly<DataView<S>> | null


stats()

stats(node, player?): InputStats | null;

Defined in: src/engine/net/messages.ts:113

Server: node's connection's counters for this stream (for its local player player, default 0); null elsewhere or before its first input.

Parameters

node

GameObject

player?

number

Returns

InputStats | null


write()

write(values, player?): void;

Defined in: src/engine/net/messages.ts:103

Client: set some of this tick's input fields (the rest keep last tick's values). player is which of the client's local players it's for (default 0; local co-op over one connection): each player's input travels and is applied on its own. Throws in a server World.

Parameters

values

Partial<Readonly<DataView<S>>>

player?

number

Returns

void

Clone this wiki locally