Skip to main content

TwistRelaxerController

A class in Root.Township, Alta.Character.

Character rig component that runs the forearm's TwistRelaxers each fixed update, scaling their weight by how far the hand is twisted against the elbow.

Constructors​

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

Fields​

6 private and internal fields
MemberWhat it is
private AnimationCurve angleToWeightMultiplierCurve from hand-to-elbow angle (degrees) to a weight multiplier.
private Transform elbowBacking field for Elbow.
private Transform handBacking field for Hand.
private bool isChangingWeightsWhen false, relaxers keep their own weight and only Relax is called.
private List<TwistRelaxer> relaxersBacking field for Relaxers.
private Dictionary<TwistRelaxer, float> relaxerStartingWeightsEach relaxer's weight at Start.

Properties​

MemberWhat it is
Transform Elbow { get; set; }Elbow (forearm) bone compared with the hand.
Transform Hand { get; set; }Hand bone compared with the elbow.
List<TwistRelaxer> Relaxers { get; set; }The twist relaxers driven by this controller.

Methods​

MemberWhat it is
override void FixedUpdateCharacterComponent()Scales each relaxer's weight by the hand-to-elbow angle curve (if enabled) and relaxes it.
2 private and internal methods
MemberWhat it is
private void Start()Stores each relaxer's starting weight.
private void Update()Empty.

Used in​

Members of other types that take, return or hold a TwistRelaxerController: