PlayerHeightFixer
A class in Root.Township, the global namespace.
Client: on the VR camera. Before each cull it raises or lowers the camera rig by the player's height setting plus any active platform offsets, clamped to a height range, and copies the result to another transform.
- Listed in Global namespace: P
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
PlayerHeightFixer() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
8 private and internal fields
| Member | What it is |
|---|---|
private Transform cachedTransform | This object's own transform (the tracked camera). |
private Transform copyTo | Transform that gets the camera's local position plus the offset, and its rotation. |
private Transform fixer | Parent transform that is moved up or down by the offset. |
private static Logger logger | NLog logger for this class. |
private float maxHeight | Highest local camera height allowed after the offset (default 3). |
private float minHeight | Lowest local camera height allowed after the offset (default 0.1). |
private PlatformHeightOffsetSettings platformHeightOffsets | Per-platform offsets added when active. |
private PlayerAdjustableHeightFixerSettings playerAdjustableHeightFixerSettings | Settings asset holding the player's chosen height adjustment. |
Properties
| Member | What it is |
|---|---|
static float ActualHeightFix { get; private set; } | The vertical offset applied this frame. The OpenXR, SteamVR and player input code add it to tracked positions. |