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
| Member | What it is |
|---|
NeckIKController() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|
private Transform headTarget | Transform the neck reaches for and the head copies. |
private bool isApplyinRotationLimitOnOverride | Whether to apply the head bone's rotation limit after overriding it. |
private bool isOverridingHeadRotation | Whether the head bone copies the target's rotation after the IK runs. |
private FABRIK neckIK | Backing field for NeckIK. |
Properties
| Member | What it is |
|---|
FABRIK NeckIK { get; set; } | The FABRIK component for the neck. |
Methods
| Member | What 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
| Member | What 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. |