A class in Root.Township, Alta.Character.
Character rig component that rotates a clavicle bone to follow where the hand (and optionally elbow) target is, using curves from PlayerSettings.ClavicleControllerSettings.
Constructors
| Member | What it is |
|---|
ClavicleController() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
7 private and internal fields
| Member | What it is |
|---|
private Transform body | Backing field for Body. |
private Transform clavicle | Backing field for Clavicle. |
private Transform elbowTarget | Backing field for ElbowTarget. |
private HandIndex handIndex | Backing field for HandIndex. |
private Transform handTarget | Backing field for HandTarget. |
private Quaternion previousLocalRotation | Clavicle rotation from the last fixed update, used to smooth the change. |
private Vector3 startingLocalRotation | Clavicle's local Euler rotation at Start, which the computed offsets are added to. |
Properties
| Member | What it is |
|---|
Transform Body { get; set; } | Body transform the hand and elbow targets are measured against. |
Transform Clavicle { get; set; } | The clavicle bone this controller rotates. |
Transform ElbowTarget { get; set; } | Elbow IK target, averaged with the hand for the Y rotation when the settings say so. |
HandIndex HandIndex { get; set; } | Which arm this is; the left side flips the Y rotation and the right side mirrors X. |
Transform HandTarget { get; set; } | Hand IK target the clavicle reacts to. |
1 private and internal property
| Member | What it is |
|---|
private ClavicleControllerSettings Settings { get; } | Shortcut to PlayerSettings.ClavicleControllerSettings (curves, multipliers and clamps). |
Methods
| Member | What it is |
|---|
override void FixedUpdateCharacterComponent() | Works out Y and Z clavicle rotation from the hand position via the settings curves, clamps them and applies them to the bone. |
1 private and internal method
| Member | What it is |
|---|
private void Start() | Stores the clavicle's starting local rotation as the base for later offsets. |
Used in
Members of other types that take, return or hold a ClavicleController: