ik for fingers

Does Unity’s avatar IK system’s API even support performing IK with fingers, or anything other than LeftFoot, RightFoot, LeftHand or RightHand? It sounds to me like you’d have to implement your own IK system for performing IK with individual fingers, because Animator.SetIKPosition, Animator.SetIKPositionWeight, Animator.SetIKRotation and Animator.SetIKRotationWeight take the AvatarIKGoal enumerated type, whose only possible values are LeftFoot, RightFoot, LeftHand or RightHand. There’s no way to tell it to perform IK on fingers, or anything but feet and hands.

AvatarIKGoal Description: IK Goal.

Used to set and get IK weights, position and rotation. See Also: Animator.SetIKPosition, Animator.SetIKPositionWeight, Animator.SetIKRotation and Animator.SetIKRotationWeight.

Variables

LeftFoot The left foot.

RightFoot The right foot.

LeftHand The left hand.

RightHand The right hand.

1 Like

That’s right: Unity’s IK system does not involves fingers.

This makes mecanim basically useless for a lot of use cases., is there any reason why fingers are not included in IK? I can’t even control them via code either as the IK animator controller just resets them.

Use the Animation Rigging package. Mecanim is for managing state.

I figured out the way around it, excluded the fingers from the IK animation layer on the animation controller

Bit late, but how did you do this without also excluding the hands?

Using the IK animation layer https://docs.unity3d.com/Manual/AnimationLayers.html

1 Like

Hmm. Bit strange. The only way I could get this to “work” was at play time in the editor to toggle the IK Pass off/on in the editor manually. Otherwise the finger transforms in the mask would have no effect and hand ik rotations would override all my finger animation rotations.

8961168--1231128--upload_2023-4-20_9-59-9.png

EDIT: User error. The IK Pass layer needs be above the layer that contains the animations with the finger rotations. For example:

Layer 0: default locomotion (walk, run, jump etc)
Layer 1: Empty layer for Hand IK (IK Pass enabled) with fingers masked using Transforms
Layer 2: Upper body mask and animations that include finger position/rotations

Now working as expected.