【無料】UdonSharp(U#)入門 v5.4|VRChatワールド・ギミックをゼロから作る初心者向け教科書
- 無料ダウンロード商品¥ 0
- 支援ダウンロード商品¥ 1,000








プログラミングの入門書です。 題材にVRChatのワールドギミックとUdonSharpを使います。 全155項目でPDF 1,786ページあります。 無料です。 WEB版 本編(おまけ付き) https://vrc-ref-ja.codho-vrc.workers.dev/ 最初に覚えるのは変数と条件分岐です。 次に処理がどの順番で呼ばれるかを追います。 ドアが開かない原因がコードの書き間違いか呼ばれる順番かを見分けられるところまで進みます。 ここはC#の基本なのでVRChatの外でも同じです。 すでにC#を書ける人に第1部と第2部は要りません。 Unityを起動したことがない段階から始まります。 第0部の33章はU#を1行も書きません。 マテリアルとライティングを整えてワールドを1つアップロードしてからコードに入ります。 巻頭に「さわってみよう」を置きました。 理屈は後回しにして押すと動くモノを1つ置くところまで通します。 そのあと第0部に戻ってください。 後半は毛色が変わります。 第6部は調べても出てこない挙動を集めた章です。 鏡はReflect Layersを絞らないと映さなくていい物まで描きます。 他人がQuestかPCかはU#から取れません。 サーバー時刻の引き算は一周すると壊れます。 第7部はU#にできないことの一覧と貼れば動くテンプレです。 無料なので中身を見てから時間を使うか決めてください。 ■ 同作者の無料ワールドギミック配布(30種類以上) https://pon-poko-pon.booth.pm/ ■ English edition available (free) An English translation is included - a 1,899-page PDF. Select the "English" variation above to download it. Never written a line of code? It starts with the Unity work that needs no code at all, and ends with a complete game world in VRChat. Full details in the "English edition" section at the bottom of this page.
概要
全155項目(第0部33章+本編109章+付録13本)のPDFです。 C#の変数と条件分岐から始めます。 最後にマルチプレイで動くゲームワールドを1本作り終えます。 プログラミングの入門書とVRChatのギミック解説を行き来しなくて済むように1冊にまとめました。 章をまたぐリンクはクリックで飛べます。 ネットにつながっていなくても開けます。 英語版もあります(上の「English」を選んでください。無料)。
学べる内容
- UdonSharpでできることとできないこと - 変数・条件分岐・配列・関数といったプログラムの基本 - コードを書かずにワールドを1つアップロードするまでのUnity操作 - ドア・スイッチ・テレポーター・スコアボードの作り方 - ネットワーク同期と後から入った人への状態の合わせ方 - イベントの実行順が原因の不具合の切り分け方 - PvPシューター・人狼・脱出・音ゲーなど11ジャンルのゲームワールドを最後まで作る手順 - 重いと感じたらStats窓とProfilerで原因を測ってから直す手順とQuest対応
注意点
- プログラミング初心者向けの本です - Unity 2022.3とVRChat SDK 3.10.xを前提に書いています - SDKが更新されると画面や手順が本と違うことがあります
■ 内容
第0部: コードを書かないワールド制作の基礎33章(Unityエディタ操作・形づくり・マテリアル・シェーダー・ライティング・音・アニメ・パーティクル・SDK配置・アップロードまで。U#を書く前の土台) 第1部: C#基礎15章(変数・計算・文字列・条件分岐・繰り返し・配列・メソッド) 第2部: UdonSharp基礎12章(UdonSharpBehaviour・GetComponent・継承・型・ゲームループ・デバッグ) 第3部: ワールド開発16章(イベント・イベントの実行順・入力イベント・入退室・VRCPlayerApi・Ownership・ネットワーク同期・遅延同期) 第4部: 技術トピック33章(Raycast・射撃・ダメージ同期・トリガー・ボーンとポーズ認識・UI・Animator・演出・シェーダー制御・音声・動画プレイヤー・Pickup・ObjectPool・役職配布・ステートマシン・ショップ・敵AI・乗り物・DataListとJSON・永続化・自前サーバー連携・物理・同期最適化・実戦の同期パターン集) 第5部: 11ジャンルの実践チュートリアル(PvPシューター / 人狼 / 脱出ゲーム / ホラー / RPG / アスレチック / ボードゲーム / タワーディフェンス / 音ゲー / チルワールド / スポーツ) 第6部: 公開・運用と発展テクニック16章(QuestとAndroid対応・計測して軽くする最適化・ロード時間とメモリ・サーバー時刻の罠・壁を貫通するHUDなど調べないと分からない隠れ仕様) 第7部: 実戦リファレンス編6章(できないこと全集・貼って動く実装テンプレ・ジャンル別スケルトン・シーン構成レシピ・ビルド検証ループ・境界カタログ) 付録A〜M(13本): 逆引きインデックス+テンプレート・APIチートシート・エラー逆引き辞典・用語集・VCCパッケージ一覧・おすすめリソース・OOP発展・C#一般知識・検索と調べ方・公開前チェックリスト・AI生成コード検証術・Unityエディタ拡張の自作・アルゴリズム演習
■ こんな人向け
- プログラミングは未経験だけど押すと動くギミックをワールドに置きたい - ネットで見つけたU#のコードを少し変えたら動かなくなった - 自分の画面では開いたドアが後から入った人には閉まって見える
利用規約
この教材は自由に改変・配布OKです。 この本を元に別の入門教材や勉強会の資料を作ってもかまいません。 本書は現状のまま提供します。 記載の対応バージョン以外での動作は保証しません。 サポートやアップデートは行うことがありますが必ず行うとは約束しません。 不具合報告は歓迎します。 直すかどうかといつ直すかは作者が決めます。
更新履歴
2022/12/20 v1.0 公開 2023/05/01 v3.0 目次と仕組みの解説を改善 2026/04/01 v4.0 35章+付録8本に拡張 2026/04/12 PDF版を追加 2026/06/08 v4.5 第0部(31章)を新設 2026/07/15 v5.0 第7部と新章6本と英語版を追加 2026/08/18 v5.1 新章3本を追加 2026/10/30 v5.2 環境構築と入力の手順を補足 / 誤りを訂正 2026/10/31 v5.3 Blenderの章を追加 / サーバー時刻のコードを訂正 2026/12/02 v5.4 入力イベントの章とアルゴリズム演習の付録を追加 / 記述とコードの誤りを訂正 ────────────── ■ もっと本格的に学びたい方へ 基礎を終えた次の一冊に別作者の有料教材もあります。 https://tommyudonfactory.booth.pm/items/4890389
English edition (英語版)
An English edition is included, free of charge. Select the "English" variation above to download it. = Learn Programming with UDON# v5.4 = A programming primer for people who have never written a line of code. VRChat world gimmicks and UdonSharp are the material. You start in the Unity editor without writing code, and finish with a game world other players can join. Each chapter introduces one concept. 155 parts in total (Part 0: 33 chapters + main body: 109 chapters + 13 appendices). 1,899 pages. PDF, readable offline. --- Get something running first --- The book opens with "Try it first." You place an object that reacts when you press it, before reading any explanation of why it works. The explanation waits until Part 0. --- Who it's for --- - You've never programmed and never used Unity, but you want to build gimmicks in VRChat - You've hit the ceiling of the Udon node graph and want to move to UdonSharp - You can modify someone else's sample, but you can't write one from scratch --- Not for you if --- You already know C#, Unity and network sync. The early parts will bore you. That said, Parts 4 through 7 are written for implementation rather than instruction, so the sync patterns and the constraint catalog may still earn their keep. --- What you'll be able to do --- - Build your own original world - Add doors, switches, pickups and other moving parts to it - Understand network sync well enough to build multiplayer gimmicks that don't desync - Read the basic UdonSharp grammar and write it yourself --- The hidden specs --- Part 6 collects behavior that surfaces after your world already runs: - A mirror draws objects it doesn't need to unless you narrow its Reflect Layers - U# can't tell you whether another player is on Quest or PC - Subtracting server times breaks once the clock wraps around - WorldSpace text turns gray depending on where you look - Billboards and direction indicators break in VR in a way they never do on a flat screen - Late joiners, timers and day/night cycles disagree unless you make them agree Part 7 is the constraint model: what UdonSharp cannot do, gathered in one place, plus paste-and-go templates, genre skeletons, scene recipes, a build & verify loop, and a boundary catalog. You open it while implementing rather than while reading. --- What's inside --- Part 0: World building without writing code (33 chapters) The Unity editor, bringing in a model made in Blender, shaping geometry, materials, shaders, lighting and baking, audio, animation, particles, VRC constraints, colliders and layers, mirrors and portals, Build & Test, uploading. Everything before your first line of U#. Part 1: C# basics (15) Variables, numbers, strings, branching, loops, arrays, methods. Part 2: UdonSharp basics (12) UdonSharpBehaviour, GetComponent, inheritance, value vs reference types, null handling, the game loop, debugging. Part 3: VRChat world development (16) Events, the order events run in, input events, join/leave, VRCPlayerApi, Ownership, UdonSynced, OnDeserialization, SendCustomNetworkEvent, delayed execution, network pitfalls. Part 4: Technical topics (33) Raycast, shooting, damage sync, colliders and triggers, area detection, bones and pose detection, Canvas and UI, Animator, Lerp and game feel, driving shaders from Udon, audio, voice chat, video players and URL sync, Pickup, Object Pool, role assignment, buffs and jobs, state machines, lobbies, voting, shops, respawn and spectating, host defense, enemy AI and NavMesh, crowd control, VRCStation and vehicles, DataList/DataDictionary/VRCJson, PlayerData and persistence, talking to your own server, physics and throwing, sync optimization, field-tested sync patterns. Part 5: Building real games by genre (11) PvP shooter, social deduction, escape room, horror survival, RPG and co-op PvE, parkour and racing, board and card games, tower defense, rhythm, chill and social spaces, sports. Each one is a full build. Part 6: Publishing, operations and advanced techniques (16) Quest and Android, measure-then-optimize, render cost, textures and VRAM budget, hidden memory hogs and load times, script CPU cost, lighting and shader cost, plus the hidden-spec chapters above. Part 7: Practical reference (6) The constraint model, pattern library, genre skeletons, scene recipes, the build & verify loop, boundary catalog. Appendices A-M (13) Reverse index and templates, API cheat sheet, error lookup dictionary, glossary, VCC package list, recommended resources, advanced OOP, general C#, how to search and research, pre-release checklist, verifying AI-generated code, writing your own Unity editor extensions, algorithm exercises. --- What's new since v5.1 --- - A new chapter on input events (29c) and a new appendix of algorithm exercises (Appendix M) - A chapter on bringing a model made in Blender into Unity (0-8b) - Game math added where it's used: how a jump feels, the launch speed that reaches a target, weighted gacha, ties and majorities in votes - "Math memo" asides that check a chapter's calculations with real numbers - Findings from testing in a world: synced variables that don't arrive, how far Interact reaches, the file-size limit on PC, Normalize() doing nothing in Udon - The code that subtracts server times is corrected in every chapter (it wraps around after about 49.7 days) - Corrections to match the official documentation (Owner transfer, GetPlayers() with no arguments, VRCInstantiate) and code fixes in the lobby, double jump, tower defense, rhythm game and poker chapters - Every chapter links back to the contents, and chapter-number references are now links - The English edition matches the Japanese v5.4 --- How each chapter is built --- - One new concept per chapter, and only one - Something that runs, plus an exercise to modify it, with solutions - An "if you get stuck" error table - A three-line summary - Difficulty is marked Lv1-10 with a green/yellow/red band, so you can skip ahead honestly --- Format --- PDF, 1,899 pages. Works offline, with no account and no internet connection. Internal cross-chapter links are clickable, so you can use it as a reference after you've read it. --- Please read this before downloading: about the screenshots --- This is the English edition of a book originally written in Japanese. The text, code, code comments and instructions are in English, and menu paths are given in English. The Unity and VRChat screenshots still show the Japanese editor UI. I have not recaptured them. Menu positions are identical in both languages, so you can follow along using the English paths in the text. Some explanatory diagrams also have Japanese text drawn into the image itself. Everything those diagrams show is also explained in the surrounding English text, but the diagrams themselves are not translated. It's free. Please take a look and decide for yourself before you commit any time to it. --- Written against the current SDK --- Written to match the official VRChat documentation as of December 2026 (Unity 2022.3, VRChat SDK 3.10.x): passing arguments to network events, PlayerData and persistence, Player Objects, sync bandwidth figures and so on. VRChat changes often, so treat the code here as one example rather than the only way, and read the official docs alongside it when you build for real. --- Terms of use --- You are free to modify and redistribute this material. You may also use it as the basis for other beginner material or study-group handouts. Provided as-is. Behavior on SDK versions other than the one stated is not guaranteed. Support and updates may be provided, but are not an obligation. Bug reports are welcome; whether and when a fix ships is at the author's discretion. --- More free world gimmicks by the same author --- Over 30 free VRChat world gimmicks, also free: https://pon-poko-pon.booth.pm/








