Skip to content

Climbing Gravity Manager

eisclimber edited this page Apr 20, 2024 · 2 revisions

Climbing Gravity Manager

class in ExPresSXR.Rig / Extends PlayerForceBase
Component added via Component Menu

Description

Controls the player and its LocomotionSystem to enable and orchestrate climbing.
This includes requirements for the number of grabbed interactors, pushing off a wall, gravity appliance and enabling teleportation.

Members

Editor Properties

  • int _minGrabbedHolds: How many interactables (inclusive) must be held to not fall. Should be greater than 0. Default: 1

  • bool _applyReleaseVelocity: If enabled, will apply an impulse to the player when climbing is ended. This is based on its velocity scaled by _releaseStrengthFactor.

  • float _releaseStrengthFactor: Factor to the velocity that is then applied as an impulse to the player when releasing a climb.

  • PlayerGravity _playerGravity: Applies the gravity to the player.

  • PlayerRigidForce _playerRigidForce: Applies the impulse to the player when ending a climb.

  • AverageVelocity _playerAverageVelocity: Used to read the players velocity. Should be set to the GameObject that is driven by locomotion (i.e. the root of your ExPresS XR Rig)

Public Properties

  • XRBaseControllerInteractor[] climbInteractors: (Readonly) The interactors used for climbing. Usually direct interactors.
  • int grabbedHolds: (Readonly) Number of holds (ClimbInteractors) currently grabbed.

Protected Methods

  • virtual void ApplyReleaseVelocity(): Called when a climb is released and applies the release velocity if enabled.
  • virtual void DisableExternalForces(): Called when a climb is stared, disabling external forces (gravity and rigid forces).
  • virtual void EnableExternalForces(): Called when a climb ends, enabling external forces (gravity and rigid forces).

Public Methods

  • void RegisterInteractors(): Sets up and checks the configured ClimbInteractors.
  • void UnregisterInteractors(): Unregisters the configured ClimbInteractors.

Events

  • OnGrabHoldSuccess: UnityEvent emitted, when the player interacts with enough ClimbInteractables to start climbing.
  • OnGrabHoldFailed: UnityEvent emitted, when the player does not interacts with enough ClimbInteractables to continue climbing.

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally