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().
What the original does
Section titled “What the original does”- Player clicks the chair —
Interact()triggersUseAttachedStation(). OnStationEnteredtakes ownership, broadcasts “disable collider”, turns on anAnimatorbool.- On every
LateUpdatewhile seated, computes the minimumyover four lower-leg bones and the minimumzover four foot bones, translates that into a seat-position offset, and sets the station’s enter point. [UdonSynced]pushes the offset to remote viewers so they see the same seat position.
Port strategy
Section titled “Port strategy”| Original | Port |
|---|---|
VRCStation + UseAttachedStation() | CCK CVRSeat, UnityEvents → OnSitClicked() / OnStandClicked() |
GetBonePosition(HumanBodyBones.*) | Player.GetCurrentHeight() (scalar only) |
| Per-bone fit | Linear: delta.y = (h − referenceHeight) * verticalGain |
[UdonSynced] + RequestSerialization | BufferReaderWriter + Networking.SendMessage(..., Reliable) |
OnPlayerJoined → re-sync | Same event name in WASM (plain method) |
Wiring
Section titled “Wiring”- Put
AutoAdjustSeaton the chair root. - Add a CCK
CVRSeatto the same GameObject; wire its On Sit Down UnityEvent toAutoAdjustSeat.OnSitClickedand On Stand Up toOnStandClicked. - Assign the
Animatorand theenterPointtransform (the child the seat uses as its anchor). - Set
referenceHeightto your “ideal” seated avatar height.verticalGaincontrols how aggressively the seat drops for short avatars.