Skip to main content

NeckIKController

A class in Root.Township, Alta.Character.

Character component that runs a FABRIK neck IK toward the head target and can force the head bone to the target's rotation.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private Transform headTargetTransform the neck reaches for and the head copies.
private bool isApplyinRotationLimitOnOverrideWhether to apply the head bone's rotation limit after overriding it.
private bool isOverridingHeadRotationWhether the head bone copies the target's rotation after the IK runs.
private FABRIK neckIKBacking field for NeckIK.

Properties​

MemberWhat it is
FABRIK NeckIK { get; set; }The FABRIK component for the neck.

Methods​

MemberWhat it is
override void FixedUpdateCharacterComponent()Updates the neck IK, overrides the head rotation, then runs the base fixed update.
void SetActive(bool isActive)Turns the neck IK component on or off. Logs a warning if there is none.
2 private and internal methods
MemberWhat it is
private void OnValidate()In the editor, sets the head target as the IK solver's target.
private void OverrideHeadRotation()If enabled, sets the third neck bone's rotation to the head target's and optionally applies its rotation limit.