Skip to content

Unity Multiplayer

Unity multiplayer is provided by cn.indiegp.sdk.unity.multiplayer. The core cn.indiegp.sdk.unity package contains no multiplayer types or sockets.

  • IGP.Multiplayer: Hosted, Room, Realtime, KCP/UDP, diagnostics, and events. Mirror is not required.
  • IGP.Multiplayer.Mirror: optional Mirror transport compiled when MIRROR is defined.

Place IGPRuntimeManager and IGPMultiplayerRuntime on one persistent GameObject and call IGPRuntimeManager.InitializeAsync() once. Multiplayer reads the same IGPConfig through the core runtime context. It automatically requests a descriptor and starts KCP/UDP when Hosted plus Room/Player context is valid.

KCP is required for Ready. Raw UDP is optional and never falls back to KCP for unreliable payloads. KCP interruption reacquires the descriptor after 1s, 2s, 5s, 10s, 30s, capped at 30 seconds.

For Mirror, explicitly assign the runtime on IGPMirrorTransport, then assign the transport to NetworkManager.transport. ClientConnect() and ServerStart() only retain logical intent; they do not start KCP/UDP or control Mirror.NetworkManager.

See samples/unity/2022.3.62f3c1/sample/Examples/ for Unity code examples.