Repository navigation
API Function defineInput
github-actions[bot] edited this page Nov 28, 2026
·
3 revisions
function defineInput<S>(
id,
schema,
options?
): InputDef<S>;Defined in: src/engine/net/input.ts:163
Declare an input stream. Both ends of a connection must define the same streams, with the same schemas (the handshake checks), before they connect.
export const Move = defineInput("game.Move", { x: f32, y: f32, jump: u8 });
Move.write({ x: stick.x, jump: pressed ? 1 : 0 }); // client, in fixedUpdate
const input = Move.of(connection); // server, in fixedUpdate
if (input) body.velocity.x = input.x * speed;S extends Schema
string
S
InputOptions = {}
InputDef<S>
This wiki is generated from docs/wiki/ and the myco module's source on every push to master. Change pages there in a pull request: edits made here are not kept.
Basics
Gameplay
Rendering
Audio
- Playing sound
- Why is there no sound?
- Playlists
- Interactive music
- Sound generators
- Spatial audio
- Audio mixer
- Live mixing
- Loudness
- Audio profiler
- Audio takes
Reference