Skip to content

HnFClimbing port

TL;DR: HnFClimbing detects VR controller grip and anchors the player’s motion to the hand that started the grab. CVR WASM exposes grip axes (CVRInput.GripLeft, CVRInput.GripRight) but no hand transforms. The port uses the head viewpoint (Player.GetViewPoint()) as a “hand” proxy — adequate for the mechanic but not a perfect match — and drops the player-grab-other-player feature entirely (needs remote bone access).

FeaturePorts?
Grip detectionYes — CVRInput.GripLeft / GripRight
Wall trigger detectionYes — OnPlayerTriggerEnter / OnPlayerTriggerExit
Player motion while grippingPartial — uses head viewpoint as hand proxy
Stamina bar, recoveryYes — pure numeric
HUD attached to handPartial — attaches to head instead; hand transforms not exposed
Player scale syncPartial — CVR has no avatar-scale event
Grabbing other players by bonesNo — no remote bone access
Jump height adjustNo — no WASM API for it

OnPlayerTriggerEnter(Player player) fires when any player overlaps the trigger. Filter to the local player (LocalPlayer.PlayerObject) and track insideTrigger. In Update, while insideTrigger && CVRInput.GripLeft > threshold, read the head viewpoint position, convert to the wall’s local space, and move the local player by the opposite delta via LocalPlayer.SetPosition() + LocalPlayer.SignalDiscontinuity(). Stamina ticks down while gripping, recovers otherwise.

The HUD (HnFStaminaBar) pins itself to the head via view.GetPointPosition() + view.GetPointRotation() * headOffset each LateUpdate. Set renderOnLeftHand has no effect here — there’s no hand transform to pin to.

  1. Collider on the climbable wall, IsTrigger = true. Add HnFClimbing to it.
  2. Separate HUD root with HnFStaminaBar. Assign output (a world-space Text) and staminaGraphicAnimator if you have one. Drop it onto HnFClimbing.staminaBar.
  3. Tune GripThreshold (0.75 is a good default), MaxStamina (seconds of continuous grab), and StaminaRecoveryRate.