Logo de Unity Netcode

Unity Netcode

ComunidadePopular
Besty0728
unity-netcode

Set up Netcode for GameObjects (NGO 2.x) multiplayer

Visão geral

Publicado porBesty0728
RepositórioUnity-Skills
Nome da habilidadeunity-netcode
Estrelas
1.8K
Forks
164
Arquivos incluídos
Somente instruções
LicençaMIT
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Sem arquivos extras

    Tudo de que o modelo precisa está nas instruções — sem arquivos extras para sincronizar.

  • Código aberto

    Publicada por Besty0728 no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Unity Netcode no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/Besty0728/Unity-Skills/tree/main/SkillsForUnity/unity-skills~/skills/netcode
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.

Use no TypingMind

Ative Unity Netcode em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Unity Netcode automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Unity Netcode não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

Before calling any skill in this module: if you are about to call a skill with parameters guessed from its name or description, STOP — read this file (or fetch its schema via GET /skills/recommend?includeSchema=true) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.

Triggers

  • Scaffolding multiplayer
  • Registering network prefabs
  • Wiring spawn logic
  • Starting host/server/client
  • 搭建多人联机、注册网络预制体、连接生成逻辑、启动 host/server/client

Unity Netcode for GameObjects Skills

Automation for Netcode for GameObjects (NGO) multiplayer setup and operations. Every skill is source-verified against NGO 2.x; when the package is absent, each skill returns a NoNetcode() error with install instructions. A subset of skills additionally require NGO 2.5.0+ (see NGO 2.5+ features) — on an older 2.x install they return a structured "requires 2.5.0+" error instead of a compile error, since AttachableBehaviour/AttachableNode/ComponentController are detected by reflection, not by a dedicated version symbol.

Requires: com.unity.netcode.gameobjects (2.x), Unity 6000.0+. Strongly recommended: before calling any netcode_* skill, load netcode-design. NGO lifecycle and permission rules are strict; skills alone cannot prevent incorrect business code.

Guardrails

Operating Mode (v1.9 three-tier):

  • Approval (default): query/list/info skills (netcode_check_setup, netcode_get_manager_info, netcode_get_transport_info, netcode_list_network_objects, netcode_get_network_object_info, netcode_list_network_prefabs, netcode_list_network_behaviours, netcode_get_spawn_manager_info, netcode_get_scene_manager_info, netcode_get_status, netcode_version, netcode_attachable_info) run directly. Mutators (create/configure/attach/add) are FullAuto — on MODE_RESTRICTED, run the grant protocol.
  • Auto / Bypass: SemiAuto and FullAuto run directly.
  • Auto-forbidden in this module:
    • SkillOperation.Delete → netcode_remove_manager, netcode_remove_network_object, netcode_remove_from_prefabs_list
    • MayTriggerReload = true → netcode_add_network_behaviour_script (writes a new .cs, forces script compile + Domain Reload)
    • MayEnterPlayMode = true → netcode_start_host, netcode_start_server, netcode_start_client, netcode_shutdown
    These are reachable only under Bypass mode or via a user-managed Allowlist entry; the grant flow returns MODE_FORBIDDEN. Runtime control + Behaviour-script generation are the practical reason this module is gated.
  • When com.unity.netcode.gameobjects is missing, every skill returns a NoNetcode() error with install instructions.

DO NOT (common hallucinations):

  • netcode_spawn_object / netcode_spawn_player — do not exist. Spawn must happen in runtime code (NetworkBehaviour) via .Spawn() or NetworkManager.SpawnManager.InstantiateAndSpawn. Skills do not proxy Spawn because Spawn requires a running NetworkManager.
  • netcode_register_scene — does not exist. Scene registration goes through Build Settings + EnableSceneManagement. This module only exposes netcode_configure_scene_management for reading/writing the config.
  • netcode_set_tick_rate / netcode_set_protocol as standalone skills — do not exist. Use netcode_configure_manager for all NetworkConfig edits.
  • Do not assume netcode_start_host works in Edit Mode. All Runtime control skills require PlayMode.
  • Do not assume netcode_add_to_prefabs_list automatically attaches a NetworkObject component. Call netcode_add_network_object first.

Routing:

  • Plain GameObject hierarchy creation → gameobject
  • Attach NetworkObject / NetworkTransform / other networking components → this module
  • Generic player-prefab components (Rigidbody / Collider / Animator) → component
  • Runtime scene switching (LoadScene) → call NetworkManager.SceneManager.LoadScene from the generated NetworkBehaviour; this module does not execute it
  • Code-level design decisions (RPC direction, NetworkVariable permission) → netcode-design advisory

Object Targeting

netcode_add_* / netcode_configure_* skills use the usual target parameters:

  • name — scene object name
  • instanceId — Unity InstanceID (exact)
  • path — hierarchy path Parent/Child

Prefer instanceId when there is a chance of duplicate names.

Skills

Setup & Validation

SkillPurposeKey Parameters
netcode_check_setupVerify package, NetworkManager, Transport, PlayerPrefab, and PrefabsList consistencyverbose?
netcode_create_managerCreate NetworkManager + UnityTransportname?
netcode_configure_managerBulk-edit NetworkConfig (TickRate, ConnectionApproval, EnableSceneManagement, NetworkTopology, ...)name?, 15+ optional fields
netcode_get_manager_infoRead NetworkConfig + runtime statename?
netcode_remove_managerDelete the NetworkManager (must already be Shutdown)name?

Transport

SkillPurposeKey Parameters
netcode_set_transport_addressDirect connection: set Address / Port / ServerListenAddressaddress, port, serverListenAddress?
netcode_set_relay_server_dataRelay mode (mutually exclusive with direct connection)address, port, allocationIdBase64, keyBase64, connectionDataBase64, hostConnectionDataBase64?, isSecure?
netcode_set_debug_simulatorSimulate latency / jitter / packet loss (development only)packetDelay, packetJitter, dropRate
netcode_get_transport_infoRead current transport infoname?

NetworkObject

SkillPurposeKey Parameters
netcode_add_network_objectAttach NetworkObject to a GameObjectname/instanceId/path + NetworkObject fields
netcode_configure_network_objectModify fields on an existing NetworkObjectsame as above
netcode_remove_network_objectRemove a NetworkObject (must not be currently spawned)same as above
netcode_list_network_objectsList all NetworkObjects in scene (including runtime state)includeInactive?
netcode_get_network_object_infoQuery a single NetworkObject in detailsame as above

NetworkPrefabsList

SkillPurposeKey Parameters
netcode_create_prefabs_listCreate a NetworkPrefabsList assetpath, assignToManager?
netcode_add_to_prefabs_listAdd a prefab (optional override: None/Prefab/Hash)listPath, prefabPath, overrideMode?, ...
netcode_remove_from_prefabs_listRemove a prefab entrylistPath, prefabPath
netcode_list_network_prefabsList every entry with its hashlistPath
netcode_set_player_prefabSet NetworkConfig.PlayerPrefabprefabPath, name?

Components

SkillPurposeKey Parameters
netcode_add_network_transformAttach NetworkTransform with axis sync togglestarget + 15 optional fields
netcode_configure_network_transformEdit fields / thresholds on an existing NTincludes PositionThreshold etc.
netcode_add_network_rigidbodyAttach NetworkRigidbody / NetworkRigidbody2DuseRigidbody2D?, useRigidBodyForMotion?
netcode_add_network_animatorAttach NetworkAnimator (Animator required)target
netcode_add_network_behaviour_scriptGenerate a NetworkBehaviour script template (OnNetworkSpawn/Despawn + optional RPC/NetworkVariable/Ownership/NGO 2.5+ OnNetworkPreDespawn)className, path, includeRpc?, includeNetworkVariable?, includeOwnershipCallbacks?, includePreDespawn?
netcode_list_network_behavioursList NetworkBehaviour subclass instances in the sceneincludeInactive?

Scene & Spawning Query

SkillPurpose
netcode_configure_scene_managementSet EnableSceneManagement / LoadSceneTimeOut / ClientSynchronizationMode
netcode_get_spawn_manager_infoRuntime: list SpawnedObjects
netcode_get_scene_manager_infoRuntime: read scene load state

Runtime Control (PlayMode required)

SkillPurpose
netcode_start_hostStart Host
netcode_start_serverStart Server
netcode_start_clientStart Client
netcode_shutdownShut down (optional discardMessageQueue)
netcode_get_statusRead IsHost / IsServer / IsClient, LocalClientId, ConnectedClients, NetworkTime

NGO 2.5+ Features {#ngo-25-features}

Added in Netcode for GameObjects 2.5.0 (verified against the package CHANGELOG, PR #3518): AttachableBehaviour / AttachableNode are an alternate "attach" parenting system that avoids the classic NetworkObject parenting pitfalls; ComponentController network-synchronizes the enabled/disabled state of a list of components. On NGO 2.0–2.4.x (NETCODE_GAMEOBJECTS is still active, but these types don't exist yet) every skill below returns a structured requires 2.5.0+ error instead of failing — call netcode_version first to confirm.

SkillPurposeKey Parameters
netcode_versionReport installed NGO version and 2.5+ feature availability—
netcode_attachable_infoAudit the scene's AttachableBehaviour / AttachableNode / ComponentController distributionincludeInactive?
netcode_attachable_addAttach an AttachableBehaviour to a GameObject nested under a NetworkObjecttarget + autoDetach? (None/OnAttachNodeDestroy/OnDespawn/OnOwnershipChange, comma-separated)
netcode_attachable_node_addAttach an AttachableNode (the socket an AttachableBehaviour attaches to)target + detachOnDespawn?
netcode_component_controller_addAttach a ComponentController to a GameObjecttarget + startEnabled?
netcode_component_controller_configureSet StartEnabled and/or populate the synchronized component list from target GameObjects (mirrors dragging a GameObject onto the Components field in the Inspector)target, targetPaths?, clearExisting?, startEnabled?

Notes:

  • AttachableBehaviour must live on a child GameObject nested under a NetworkObject's hierarchy, not directly on the NetworkObject's own GameObject.
  • AttachableNode must belong to a different NetworkObject than the AttachableBehaviour instances attaching to it.
  • Attach() / Detach() are runtime-only calls (require both instances spawned) and are intentionally not exposed as skills — same rationale as netcode_spawn_object not existing (see DO NOT above): the caller must already have a running NetworkManager and do this from NetworkBehaviour code.
  • netcode_component_controller_configure's targetPaths accepts whole GameObjects; NGO's own OnValidate() (invoked by this skill) expands each into every eligible child component with a public bool enabled property, skipping NetworkBehaviour/NetworkObject/NetworkManager — identical to what happens when you drag a GameObject onto the Components field in the Inspector.

Quick Start

python
import unity_skills as u

# 1. Inspect current state
u.call_skill("netcode_check_setup")

# 2. Create NetworkManager + UnityTransport
u.call_skill("netcode_create_manager", name="NetworkManager")

# 3. Configure the NetworkConfig
u.call_skill("netcode_configure_manager",
    tickRate=30,
    connectionApproval=False,
    enableSceneManagement=True,
    networkTopology="ClientServer")

# 4. Transport
u.call_skill("netcode_set_transport_address",
    address="127.0.0.1", port=7777, serverListenAddress="0.0.0.0")

# 5. Player prefab setup
#    NOTE: add_network_object on a prefab path depends on GameObjectFinder support.
#    Safer route: instantiate the prefab in the scene first, then attach.
u.call_skill("netcode_add_network_object", path="Assets/Prefabs/Player.prefab")
u.call_skill("netcode_create_prefabs_list", path="Assets/NetworkPrefabs.asset")
u.call_skill("netcode_add_to_prefabs_list",
    listPath="Assets/NetworkPrefabs.asset",
    prefabPath="Assets/Prefabs/Player.prefab")
u.call_skill("netcode_set_player_prefab", prefabPath="Assets/Prefabs/Player.prefab")

# 6. Generate a NetworkBehaviour template
u.call_skill("netcode_add_network_behaviour_script",
    className="PlayerController",
    path="Assets/Scripts/PlayerController.cs",
    includeRpc=True, includeNetworkVariable=True)

# 7. Drive the session in PlayMode
u.call_skill("editor_play")   # enter PlayMode
u.call_skill("netcode_start_host")
u.call_skill("netcode_get_status")
u.call_skill("netcode_shutdown")
u.call_skill("editor_stop")

Critical Rules (must read)

  1. Spawn/Despawn are not exposed as skills. They must be called from NetworkBehaviour runtime code (Server authority). Skills handle prefab registration and NetworkManager lifecycle only.
  2. PlayerPrefab must be in a NetworkPrefabsList (enforced at runtime on 2.x). Register it with netcode_add_to_prefabs_list.
  3. Runtime control skills (start_*/shutdown) require PlayMode. Calls from Edit Mode return an error.
  4. Address vs ServerListenAddress have different meaning. On a client, Address is the target server IP. On a server, ServerListenAddress is the bind address (usually 0.0.0.0).
  5. useRigidbody2D switches between NetworkRigidbody and NetworkRigidbody2D. Unrelated physics settings (e.g. Physics2D.AutoSyncTransforms) live elsewhere.

Version Scope

Targets NGO 2.x (validated against 2.13.1). Legacy 1.x (old prefabs list layout, different RPC model) is out of scope for this module. The NGO 2.5+ features skills additionally require 2.5.0+ within that range; call netcode_version to check before relying on them.

Exact Signatures

For exact parameter names, defaults, and return fields, query GET /skills/schema or unity_skills.get_skill_schema(). This document is a routing and best-practice guide, not the authoritative signature source.

Perguntas frequentes

O que a habilidade de IA Unity Netcode faz?

Set up Netcode for GameObjects (NGO 2.x) multiplayer

Por que usar Unity Netcode no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Unity Netcode é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Unity Netcode no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/Besty0728/Unity-Skills/tree/main/SkillsForUnity/unity-skills~/skills/netcode. O TypingMind lê o arquivo SKILL.md e instala a habilidade para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Unity Netcode?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Unity Netcode?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Unity Netcode com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Unity Netcode é gratuita?

Sim. A habilidade é publicada no GitHub por Besty0728 sob a licença MIT. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇