Skip to main content

NeckController

A class in Root.Township, Alta.Character.

Simple neck IK: sets the last bone to the head target's rotation and eases each bone below it toward following that rotation.

Constructors​

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

Fields​

1 private and internal field
MemberWhat it is
private Transform headTargetTransform whose rotation the head follows.

Properties​

MemberWhat it is
protected Quaternion[] CachedInverseNeutral { get; private set; }Inverse starting local rotation of each bone after the first.

Methods​

MemberWhat it is
override void UpdateCharacterComponent()Works down from the head, lerping each bone toward the bone above's rotation, then applies them all.
protected override void Awake()Maps the bones and caches the inverse of each bone's starting local rotation.