Skip to content

Player Head Collider

eisclimber edited this page Jan 18, 2024 · 1 revision

Player Head Collider

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

Description

Detects collisions of an ExPresS XR Rigs camera. It can optionally push the rig back to prevent clipping inside objects (this may be weird though) and/or display vignette effect of an ScreenCollisionIndicator when collisions occur.

Members

Editor Properties

  • Vector3 _colliderSize: Size of the SphereCollider to detect collisions with the head.

Public Properties

  • bool collisionPushbackEnabled: If enabled, will push back the pushBackAnchor when collisions are detected.
  • bool showCollisionVignetteEffect: If enabled, will show the vignette effect of an ScreenCollisionIndicator when collisions occur.
  • GameObject pushbackAnchor: The Transform that is pushed back to prevent collisions and clipping into walls.
  • float maxFadeDuration: How long in seconds the vignette effect of the ScreenCollisionIndicator takes to reach it's maximum opacity.
  • LayerMask _layerMask = 1;: Physics Layers used to detect collisions. Default-Layer: 1 = Default.

Events

  • UnityEvent OnCollisionStarted: Emitted when a collision with the head is first detected.
  • UnityEvent OnCollisionEnded: Emitted when a collision with the head ended.

Constants

  • float FLOOR_DISTANCE_THRESHOLD: Distance on which the rig is to be considered on the ground and will not be pushed to the floor.

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally