TsukimiSharp Reference
TsukimiSharp is a subset of C# that compiles to Udon, which runs inside VRChat worlds.
Getting started
Section titled “Getting started”| Page | Contents |
|---|---|
| Quick start | From installing to your first Behaviour running |
Lookup
Section titled “Lookup”| Page | Contents |
|---|---|
| Finding it by what you want to do | From what you want to do, jump to the page that shows how |
| Features UdonSharp does not have | Ways of writing and tools this language has that UdonSharp does not |
Runtime
Section titled “Runtime”| Page | Contents |
|---|---|
| Udon’s execution model | How it runs on Udon, and the reasons behind the restrictions |
| File layout and namespaces | File layout, namespaces, visibility, name resolution |
| Events | List of events the runtime calls |
| Field initialization and defaults | Field initializers, and the value when you write none |
Syntax
Section titled “Syntax”| Page | Contents |
|---|---|
| Lexical elements and literals | All forms of numeric and string literals |
| List of types | Types you can use (section below) |
| Expressions and operators | Operators, strings, null handling, primary expressions |
| Type conversions | Which conversions are supported, type tests, and boxing |
| Numeric overflow and conversion | Values on overflow, and conversions that halt |
| Null and references | Sources of null and how to handle it safely |
| Statements and control flow | Branching, loops, statement structure |
| Pattern matching | All pattern forms and exhaustiveness |
| Member declarations | All forms of members you can declare |
| Variables and passing arguments | Kinds of variables, ref / out / in, definite assignment |
| Extension methods | How to write static helpers |
| Attributes | List of attributes that have meaning to the runtime |
| Reactive programming | Writing work that runs when a value changes, on the dependent side |
| Preprocessor | Directives you can use |
| Page | Contents |
|---|---|
| async / await | Split work that does not fit in one frame and advance it piece by piece |
| Constructs allowed in an async method | Loops, branches and calls allowed in the body of an async method |
| GPU kernels and await | Bound GPU work by how many times it runs per frame |
| Page | Contents |
|---|---|
| GPU kernel | Making the GPU compute: the kernel’s shape, types, cells and coordinates |
| Kernel statements and expressions | Statements, operators, and per-type operations available inside a kernel |
| Functions callable from a kernel | Built-ins and helper functions callable from a kernel |
| Running a GPU kernel | Buffers, execution, retrieving results |
| Surface shaders (experimental) | Describe what a Renderer draws in C# (experimental) |
Machine learning models
Section titled “Machine learning models”| Page | Contents |
|---|---|
| ONNX models (experimental) | Bake a trained model in at compile time instead of loading it (experimental) |
| ONNX models on Udon (experimental) | Pass the input and output as arrays and read the result back as numbers (experimental) |
| ONNX models on the GPU (experimental) | Pass images in buffers; floating-point models; which models are accepted (experimental) |
| ONNX model operators (experimental) | The operators that are accepted, and their conditions (experimental) |
Working with Unity and VRChat
Section titled “Working with Unity and VRChat”| Page | Contents |
|---|---|
| Getting and calling components | Getting, calling, referencing |
| Calling Unity and VRChat types | Common calls, and members you cannot call |
| Sync | Synced variables, ownership, events |
| Sync design | What is guaranteed, the failures, and patterns to write |
MoCHI (experimental)
Section titled “MoCHI (experimental)”| Page | Contents |
|---|---|
| MoCHI Reference (experimental) | Describe the objects placed in a world in .mochi.xml, and generate a prefab when you save in Unity (experimental) |
| Syntax overview | Categories of elements, how tags map to GameObjects, parts and props, values fixed at generation time and values that change at runtime, expansion order, name scope |
| Element reference | For each element: syntax, where it can be placed, allowed children, attributes, what it creates, the name when name is omitted, errors |
| Value grammar | EBNF and diagnostic numbers for numbers, Vector3, Color, bool, paths, bindings, data, static, and enumerations |
| Setup and generation | Files and parts, entry points, generation on save, handling of generated files, checks before Play and upload |
| Props and identity | How props are passed, identity and key |
| Components and prefabs | Components, material copies, changes inside a prefab, <Slot> content, mount points |
| Component list | Categories of components you can write, value types, asset references, and components you can’t write |
| Physics components | Attributes of Rigidbody, colliders, joints, and more |
| Rendering components | Attributes of renderers, Light, Camera, particles, and more |
| Audio components | Attributes of AudioSource, reverb, and Audio Filters |
| UI components | Attributes of Canvas, Image, Button, layout groups, and more |
| TextMeshPro components | Attributes of TextMeshPro, TextMeshProUGUI, and more |
| VRChat components | Attributes of VRCPickup, VRCObjectSync, VRCMirrorReflection, and more |
| Other components | Attributes of Animator, constraints, NavMesh, and more |
| Layout | size and pivot, how <Row> and <Grid> arrange children, part size |
| Part with a T# script | Generated <Name>.Mochi.cs, runtime props, two-stage generation |
| inspect | Arguments when passing mochi to the MCP inspect tool, and the JSON it returns |
| Errors | List of diagnostic codes, and examples that are errors |
| Page | Contents |
|---|---|
| Testing | Running a Behaviour and checking it without launching Unity |
| Profiler | See the weight of the programs placed in your scene, as static counts and measured counts, in your browser |
| Exporting to UdonSharp | Export a Behaviour written in T# as C# that UdonSharp reads |
| MCP server | A server for calling the compiler from outside, used from AI clients |
| Skills | The instructions an AI client reads, and how to write them out |
Other lists
Section titled “Other lists”| Page | Contents |
|---|---|
| Error | Looking things up by error number |