Skip to content

Examples

TL;DR: Six self-contained scripts showing the common shapes of a CVR WASM script, plus context packs (avatar, prop, world) and UdonSharp ports for creators coming from VRChat. Each page lists the GameObjects/components you need, the script code, and extension ideas. All source files live under examples/ at the repo root, alongside these pages.

  1. In your Unity CCK Wasm project, add a CCKWasmProjectDescriptor to your content root (avatar, prop, or world root).
  2. Copy the corresponding examples/0N_*.cs file into your project’s Assets/ folder.
  3. Either drop the component onto a child GameObject or add the MonoScript to the descriptor’s includedScripts list.
  4. Wire any serialized references (TMP text, buttons, transforms, checkpoint array) in the inspector.
  5. Build via the CCK — the pipeline picks up the script, compiles it into Assets/WasmModule.wasm, and binds it at runtime.
#ExampleContextDemonstrates
01Hello WorldanyStart, Update, OnDestroy, Debug.Log, Time.time, simple serialization
02Click CounterworldButton.onClick rewiring, TextMeshProUGUI, persistent state across play sessions
03Timed AnimatoranyUpdate-driven transform animation, runtime control methods, [WasmSerialized] private fields
04Racing System with LapsworldMulti-script architecture, OnTriggerEnter, LocalPlayer, lap validation, HUD
05File-Storage NotepadworldWorldPermissions.Request, FileStorage API, TMP_InputField, graceful degradation
06Networked CounterworldNetworking.SendMessage + OnReceiveMessage, BufferReaderWriter, owner-authoritative pattern, OnInstanceOwnerChange handoff

Small scripts grouped by the CCK content descriptor they target: Avatar · Prop · World.

Ports index — five community packages (AAChair, OpenFlight, HnFClimbing, PlayerPicker, UdonChat) and six VRChat docs snippets converted side-by-side to CVR WASM, with notes on what translates and what doesn’t.

  • Ensure the CVR.CCK.Wasm package is imported.
  • First build triggers download of the .NET SDK + WASI SDK + CCK WasmModule (~300 MB, cached to %LOCALAPPDATA%/ChilloutVR/CVRBuildTools/). Subsequent builds are fast.
  • All examples adhere to the Permissions model. Copy-pasting a world example into an avatar content root will throw at runtime on the first gated call.
  • Authoring — the underlying workflow.
  • Events — which method names the build processor scans for.
  • API Overview — where to find the types used by each example.