unity-vrc-udon-sharp
БесплатноЗапускает вложенные скриптыНе проверенRules and references for VRChat UdonSharp on SDK 3.10.6, the active and verified target. UdonSharp compiles only a subset of C#, and its networking fails…
от niaka3dayo★ 374 звезды на GitHubОб этом скилле
UdonSharp Skill
Why This Skill Matters
UdonSharp looks like regular Unity C# scripting — until you hit its hidden walls. Many standard C# features (List<T>, async/await, try/catch, LINQ, generics) silently fail or refuse to compile in code that runs in the Udon runtime. Editor-evaluated field initializers are a separate context: they can use some ordinary C# features to generate a final value that Udon can hold. Networking is even more treacherous: modifying a synced variable without ownership produces no error — it just does nothing. Forgetting RequestSerialization means your state changes never leave your machine. Standard single-player local testing gives zero signal about these networking bugs because there is only one player.
Every rule in this skill exists because UdonSharp's default behavior is to fail silently. Read the rule sheets in rules/ before generating any code (see Rules).
Before Writing Network Code
Four architectural decisions that must be made before choosing sync modes or writing any synced variable. Changing them mid-implementation typically requires a full rewrite:
- Who owns this state? One owner writes; all others read. If two players can both write (e.g., a shared toggle), you need an ownership transfer protocol — writes without ownership are silently discarded.
- When does ownership transfer? On grab? Interact? Game event?
OnPlayerLeft?Networking.SetOwneris locally immediate on the calling client —Networking.IsOwner(gameObject)istruesynchronously after the call, and writing[UdonSynced]fields plusRequestSerialization()immediately afterwards is safe under anIsOwnerguard. ConcurrentSetOwnercalls from multiple clients are resolved by network arrival order — there is no client-side arbitration, so accept that the loser's write is overwritten. - What do late joiners see? State set only by one-time events (
SendCustomNetworkEvent) is invisible to late joiners. Late-joiner-visible state must live in[UdonSynced]variables, which are delivered automatically viaOnDeserialization; no manualRequestSerialization()on join is needed. - What if the owner leaves mid-session? VRChat automatically transfers ownership to a remaining player (selection rule is not publicly documented), and
OnOwnershipTransferredfires on all clients. Synced variables are preserved, so state is not frozen; decide upfront whether to keep the current value, reset to a known default, or re-apply/re-broadcast derived state inOnOwnershipTransferred.
Core Principles
- Constraints First — For Udon runtime code, assume standard C# features are blocked until verified. Treat Editor-evaluated field initializers separately and require a final Udon-supported value. Check
udonsharp-constraints.mdbefore using any API. - Ownership Before Mutation — Only the owner of an object can modify its synced variables. If the local player is not the owner,
SetOwnerfirst; then modify →RequestSerialization(Manual sync). - Late Joiner Correctness — State must be correct for players who join after events have occurred. Design for re-serialization, not just live updates.
- Sync Minimization — Every synced variable costs bandwidth (see data budget in
udonsharp-sync-selection.md). Derive what you can locally; sync only the source of truth. - Event-Driven, Not Polling — Use
OnDeserialization,[FieldChangeCallback], andSendCustomEventinstead of checking state inUpdate()for state-change reactions; for hot-path or periodic work, see Event Dispatch & Cross-Behaviour Call Cost Tiers.
Synced arrays: always apply them from OnDeserialization(). Array element
changes do not provide a reliable FieldChangeCallback signal, and the same
guidance applies to same-length changes, array reassignments, and length
changes. Have the owner call the same idempotent apply method immediately after
mutation, then request Manual serialization once. If a revision guard protects a
historical one-shot side effect, a late joiner's first OnDeserialization()
receives the current revision and may otherwise replay that effect. Baseline the
first received revision without the side effect, but run durable ApplyValues()
before the baseline check; only later revisions should trigger the one-shot.
Revision is not ordering or stale-packet protection.
Common Mistakes (NEVER List)
These Udon runtime and Unity serialization constraints cause either compile-time failures or silent data errors. Check this list before writing UdonSharp code or serialized initial values.
| # | NEVER do this | Why it fails silently | Use instead |
|---|---|---|---|
| 1 | Use List<T>, Dictionary<T,K>, or any generic collection in Udon runtime code |
Compile error — blocked by |
Установить unity-vrc-udon-sharp в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл unity-vrc-udon-sharp?
Rules and references for VRChat UdonSharp on SDK 3.10.6, the active and verified target. UdonSharp compiles only a subset of C#, and its networking fails without an error, so load this skill before writing, reviewing, debugging, or migrating any UdonSharp or UdonBehaviour code, even a short script. Covers synced runtime state and ownership, NetworkCallable events, NetworkCalling.CallingPlayer and Udon network authorization, a local public helper or public-method audit, C# to Udon conversion, persistence, data containers, web loading, UdonSharp Assembly Version Defines, and runtime API access from Udon such as VRCTween calls, VRCQualitySettings, VRCBillboard, constraint source methods, PhysBone/Contact callbacks, and world VRCPhysBoneCollider runtime access. Not for scene setup, component setup, Build Panel work, layers, scene and rendering optimization, or upload; use unity-vrc-world-sdk-3 for those.
Как установить скилл unity-vrc-udon-sharp?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл unity-vrc-udon-sharp запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic