Skip to main content

SimpleIKController

An abstract class in Root.Township, Alta.Character.

Base for the simple bone-chain controllers (NeckController, SpineController): maps a list of rig bones from the character dummy and gives them a rotation buffer and lerp factor.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private BoneIdentifier[] bonesThe rig bones in the chain.
private CharacterDummyPointer dummyPointer to the character dummy whose rig holds the bones.
private float lerpBacking field for Lerp. Default 0.5.

Properties​

MemberWhat it is
protected Transform[] Bones { get; private set; }The mapped bone transforms, in chain order.
protected int BonesLength { get; private set; }Number of bones in the chain.
protected Quaternion[] FrameRotations { get; private set; }Scratch buffer for each bone's rotation this frame.
protected float Lerp { get; }Blend factor from 0 to 1 used by subclasses.

Methods​

MemberWhat it is
protected virtual void Awake()Maps the bone identifiers to the dummy's bones and sets up the rotation buffer.