Skip to content

AAChair port

TL;DR: The VRChat original builds a station whose seat height auto-fits the avatar by sampling leg-bone positions (foot, lower leg, upper leg). CVR WASM has no station API and no remote-bone access, so the port swaps the station for a CCK CVRSeat (wired via UnityEvent) and swaps the bone math for a linear offset derived from Player.GetCurrentHeight().

  1. Player clicks the chair — Interact() triggers UseAttachedStation().
  2. OnStationEntered takes ownership, broadcasts “disable collider”, turns on an Animator bool.
  3. On every LateUpdate while seated, computes the minimum y over four lower-leg bones and the minimum z over four foot bones, translates that into a seat-position offset, and sets the station’s enter point.
  4. [UdonSynced] pushes the offset to remote viewers so they see the same seat position.
OriginalPort
VRCStation + UseAttachedStation()CCK CVRSeat, UnityEvents → OnSitClicked() / OnStandClicked()
GetBonePosition(HumanBodyBones.*)Player.GetCurrentHeight() (scalar only)
Per-bone fitLinear: delta.y = (h − referenceHeight) * verticalGain
[UdonSynced] + RequestSerializationBufferReaderWriter + Networking.SendMessage(..., Reliable)
OnPlayerJoined → re-syncSame event name in WASM (plain method)
  1. Put AutoAdjustSeat on the chair root.
  2. Add a CCK CVRSeat to the same GameObject; wire its On Sit Down UnityEvent to AutoAdjustSeat.OnSitClicked and On Stand Up to OnStandClicked.
  3. Assign the Animator and the enterPoint transform (the child the seat uses as its anchor).
  4. Set referenceHeight to your “ideal” seated avatar height. verticalGain controls how aggressively the seat drops for short avatars.

See examples/ports/AAChair/AutoAdjustSeat.cs.