FINAL IK - Full Body IK, Aim, Look At, FABRIK, CCD IK... [1.0 RELEASED]

Is there a way to leave the feet grounded no matter what bone bendings occur in the pelvis, spine and above?

Hey,
Nice! Thatā€™s a very interesting solution, glad you managed to dig in and figure it out :slight_smile:

Hey,
ik.solver.bones[index].weight = something;

Hey,
Not sure I understood what you mean. I think you could do that using a chest goal. If you assign that in the spine settings and set chest goal weight to 1, youā€™ll get another target that you can use to control the direction of the chest that is independent from the head.

Hey,
FingerRig samples the pose of the hand at start to find out which way to bend the fingers, so Iā€™m guessing those fingers are completely straight. Please try posing the fingers in a more natural relaxed way in the editor.

Hey,
If that question is about VRIK, you can enable ā€œPlant Feetā€ for the solver.

Cheers,
PƤrtel

1 Like

Errors - FinalIK & PuppetMaster

I am getting a set of errors for FinalIK & PuppetMaster. I am on 2022.3.30f1. I downloaded the package and imported. I have re-downloaded and re-imported as well, with no fix.

Any help is appreciated.

Hey,
In Unity 2023.1 they renamed AnimatorUpdateMode.AnimatePhysics to AnimatorUpdateMode.Fixed (just for shits and giggles). Final IK has packages in the Asset Store built with 2022.3.13 and 2023.1.20. For some reason you got the latter in 2022.3.30f with the renaming in the API already done.
So please either try re-downloading with an earlier version of Unity in another project and reinstalling to your real project or opening up those erroneous scripts and just renaming AnimatorUpdateMode.Fixed to AnimatorUpdateMode.AnimatePhysics wherever you can find them.

Best,
PƤrtel

1 Like

Understood. Will do. Thank you for the guidance!

Iā€™m working on integrating some animations for climbing poles and ladders. FinalIK has done wonders for me in the past, so Iā€™m wondering what might be a good strategy to align hands and feet as the model movesā€¦ Anyone done any setups for climbing?

Hello.

Thank you for answering my last question.
I am thrilled with the great assets and excellent support.
I know this is similar to the kissing rig sample, but I am struggling with it, so I would like to ask a question.

Is it possible to pass an arbitrary point A and a joint B defined within FBBIK and place joint B at arbitrary point A without changing the pose posture?
(For example, if there is a crouching motion and we pass the neck bone and place it at point (0,0,0), the position of the neck joint will be (0,0,0) while the crouching posture is maintained.)

I know it is possible to obtain this without using IK, but since the system relies on FBBIK, I would like to be able to do this within the IK calculation if possible.

Hey,
So many different ways people approach climbing. Depends on if you have your climbable objects in standardized scales or are you expecting to be able to climb any random surface (which can make the climbing system insanely complex, like Assassins Creed). With FBBIK you could just move the root of the character in the direction you want to climb, then make a script that looks for grabbable objects for each limb within a certain range from the most comfortable position. If it finds another point that is closer, move the hand/foot IK target to that.

Hey, Iā€™m sorry I donā€™t think I understood the question. If you have the character crouching move the neck bone to (0, 0, 0) without changing the posture, wouldnā€™t it just look like this?
9890409--1427553--upload_2024-6-14_15-20-3.jpg

Hi!
Iā€™ve been using Final IK for years now, itā€™s amazing! :heart:

Iā€™ve been working recently on a little interactable project, where I need my character to have IK targets for pretty much everything. So Iā€™m using the FBBIK and 2 targets for the head (one for the eyes and one for the head). Now Iā€™m getting two issues :

  1. FBBIK messes up Look At targets (if the body is rotated via FFBIK targets for example, the Look At targets get invisibly ā€œrotatedā€ along); I donā€™t know if itā€™s clear sorry! If this is expected (and not a faulty implementation), I can deal with it on my side by adding a layer of code to compensate for the ghost values, thatā€™s no problem (I just want to know if itā€™s expected or if Iā€™m doing something wrong).

  2. Since I was requiring two Look At targets, I simply put two Look At components! This worked BUT I have to disable and enable the eyes one in Runtime for it not to be overridden by the head one.
    Surely there is something smarter and less dirty to make the eyes one take over by default?
    Or even cooler, a way to add a second target to one Look At and dissociate heads and eyes?

Thank you very much! :heart:

Hey,
You gotta mind the update order of the IK components. FBBIK is normally updated after LookAtIK, so thatā€™s why it messes up look direction when it changes the rotation of the spine. You can use the IKExecutionOrder component to change that.

I hardly ever use LookAtIK myself, I just find AimIK much more powerful and flexible for that stuff. You can assign an additional pole target and use the rotation limit components on the bones. For the eyes, you donā€™t need LookAtIK either, you can use a simple script like this:

public Transform head;
    public Vector3 headForwardAxis;
    public Transform leftEye, rightEye;
    public Transform eyeTarget;
    public float clampWeight = 0.5f;
    public int clampSmoothing = 2;
    public IK lastIK; // the IK component that is updated last

    private void Start()
    {
        lastIK.GetIKSolver().OnPostUpdate += AfterLastIK;
    }

    private void AfterLastIK()
    {
        //ClampDirection clamps the look direction so the eyes don't roll back into the scull when the target is behind the head.
        Vector3 eyeForward = RootMotion.V3Tools.ClampDirection(eyeTarget.position - Vector3.Lerp(leftEye.position, rightEye.position, 0.5f), head.rotation * headForwardAxis, clampWeight, clampSmoothing);
        leftEye.forward = eyeForward;
        rightEye.forward = eyeForward;
    }

Best,
PƤrtel

2 Likes

Hi Partel, thanks for the great asset

May be a stupid question, but is it possible to change the Aim Transform at runtime cannot seem to find a way?

image

Hey,
Yes, itā€™s aimIK.solver.transform.

Best,
PƤrtel

Hi topman.

I want to use Final IK for make some static pose, so how can I use it in editor window?

e.g: I want to make a character dead pose.

Thanks~!

Hey,

  1. Add an IK component to the character (you probably already have that)
  2. Add EditorIK to the same gameobject
  3. Create/Final IK/EditorIK Pose
  4. Assign the created pose as ā€œDefault Poseā€ in EditorIK
  5. Click on the ā€œStore Default Poseā€ button in EditorIK (only appears when default pose is assigned)
  6. Click on the ā€œStart Solverā€ button.

That should get the solver running for you in the editor.

Cheers,
PƤrtel

1 Like

Hi boss,
Why do we only have Stretch tool for CCDIK, not FABRIK?
And as I searched up the topic in this discussion, I see you did provide a FABRIK stretch code to another user, so there are no differences between the two regarding stretch right.
Then, can you share some of your thought process for when you choose to go with CCDIK, when go with FABRIK when you setup a character?
Thanks!

Hey,

Hereā€™s the stretch tool for FABRIK, will be added to the next version of FIK.

CCD and FABRIK do pretty much the same thing, just with different algorithms. CCD iteratively rotates the bones one by one to get the last bone closer and closer to the target. FABRIK pulls the chain by the last bone towards the target, then pulls it the other way from the first bone to the root, like imagine having a little necklace on the table, you pull it from one end towards a point, then pull the other end towards another point, repeat and eventually itā€™s solved. Thereā€™s no guide book to which solver to use, depends on the rig and what you need to do. Usually I just try both and see which looks better.
FABRIK usually solves more accurately and using less iterations, but can be heavier on the CPU when rotation limits used.

Best,
PƤrtel

2 Likes

Hi!

I have read the source code of Hinge Rotation Limit, but I canā€™t understand how it is calculated (due to my poor math skills). Are there any literatures or materials that can help me learn and understand it?

Thx:)

Hey,
I donā€™t know of any literature specifically, I just kind of figured it out on my own, with lots of trial and error.
But basically, to make a hinge limit, that is basically a 1 degree of freedom limit, all you need to do is force 1 axis to the axis of the limit:

rotation = Quaternion.FromToRotation(rotation * axis, axis) * rotation;

That is a hinge limit without any angular limits. To apply those, youā€™ll have to keep track of delta angle frame by frame (if limits can exceed 180 degrees) and make corrections if angle is exceeding the limits just like itā€™s done in RotationLimitHinge.LimitHinge() lines 76 to 81.

Best,
PƤrtel

1 Like

Hello,
Maybe I havenā€™t read the documentation enough but Iā€™m having trouble referencing the weight value for the CCD IK component in a separate script which will be attached to an object that does not have the CCD IK component attached to it. All I have done so far is attach the CCD IK component to the limb being moved and I set up a script that attempts to reference the weight. Below is a simplified version of my custom script.

using UnityEngine;
using RootMotion.FinalIK; // Make sure to include this namespace to access Final IK components

public class CCDIkController : MonoBehaviour
{
    // Reference to the GameObject that has the CCDIK component
    public GameObject targetGameObject;

    // Reference to the CCDIK component
    private CCDIK ccdIk;

    // The current weight of the IK 
    private float currentWeight;

    void Start()
    {
        // Ensure the target GameObject is assigned
        if (targetGameObject == null)
        {
            Debug.LogError("No target GameObject assigned!");
            return;
        }

        // Get the CCDIK component from the target GameObject
        ccdIk = targetGameObject.GetComponent<CCDIK>();

        // Check if the CCDIK component exists
        if (ccdIk == null)
        {
            Debug.LogError("No CCDIK component found on the target GameObject!");
            return;
        }

        
        currentWeight = ccdIk.weight;
    }

    void Update()
    {
        // Check if the toggle key is pressed
        if (Input.GetKeyDown(toggleKey))
        {
            Debug.Log("Current Weight: "+ currentWeight);
        }
    }
}

Obviously, this implementation does not work since there is no definition for ccdIK.weight in line 35. If you could inform me as to how to properly set up my scene to be able to reference (and later change) this value during runtime would be greatly appreciated. Or if you have documentation or a previous reply here you could refer me to would also help a lot.

Also Iā€™m using version 2022.2.4f1.

Edit: I noticed that the CCDIK component contains ā€œpublic IKSolverCCD solver = new IKSolverCCD();ā€, but despite the fact that this is public, I cannot access it in another script like:

float currentWeight = ccdik.solver.IKPositionWeight;

As the error message getting suggests I might be missing a using directive or an assemble reference? Again any help would mean a lot.

Thank you.

Hello

What could be the possible problem that rigidbodies ( kinematic )
dont follow fullbody ik when I move the headeffector ?

Edit:
I tried switching to animate physics , but that makes the character glitch between the
poses sadly. So its not an option.

Solution:

Added a reference to RagdollAnimator in FBBIKHeadEffector component.
Edited the method OnPostUpdate(), inside FBBIKHeadEffector.

So it updates ragdoll after ik have happened.

ragdollAnimator.FBBKIKUpdate();

also disabled its own update / which was a LateUpdate.