Skip to main content

ClavicleController

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​

MemberWhat it is
ClavicleController()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

7 private and internal fields
MemberWhat it is
private Transform bodyBacking field for Body.
private Transform clavicleBacking field for Clavicle.
private Transform elbowTargetBacking field for ElbowTarget.
private HandIndex handIndexBacking field for HandIndex.
private Transform handTargetBacking field for HandTarget.
private Quaternion previousLocalRotationClavicle rotation from the last fixed update, used to smooth the change.
private Vector3 startingLocalRotationClavicle's local Euler rotation at Start, which the computed offsets are added to.

Properties​

MemberWhat 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
MemberWhat it is
private ClavicleControllerSettings Settings { get; }Shortcut to PlayerSettings.ClavicleControllerSettings (curves, multipliers and clamps).

Methods​

MemberWhat 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
MemberWhat 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: