FinalIK: How to control the IKTarget?

Please do not post a link to a complete project which contains licensed assets. Anybody is able to read these forums even if they don't have a license.

Here's the scene with the bones zeroed out and finalik working properly.

I just went into blender and the bone rotations there look fine, all zeroed out. Just a slight rotation on the left leg, but that can't do any harm. Bone orientations also look very neat, all-in-all a fine rigging job. Fbx is exported just fine too. Without the locomotion and bridge script, things work fine, but those scripts aren't really the problem cause they keep the rotations intact. Yet it definitely has something to do with the rotations on the bones.
I think that this is a good question for Pärtel from FinalIK. FinalIK should be able to work with the existing bone structure. The character controller doesn't apply any rotations to the different limbs so Pärtel would be more knowledgeable with what is going on.

With that said, I took your project and adjusted the scene by setting the Sphere to the FinalIK target and disabling Set Look At Target on the FinalIKBridge. Atlas looked at the target correctly (see below). For this test I used the exact project that you sent and only changed the FinalIKBridge and LookAtIK component settings.
 

Attachments

  • 1675872131452.png
    1675872131452.png
    329.7 KB · Views: 5
Please do not post a link to a complete project which contains licensed assets. Anybody is able to read these forums even if they don't have a license.


I think that this is a good question for Pärtel from FinalIK. FinalIK should be able to work with the existing bone structure. The character controller doesn't apply any rotations to the different limbs so Pärtel would be more knowledgeable with what is going on.

With that said, I took your project and adjusted the scene by setting the Sphere to the FinalIK target and disabling Set Look At Target on the FinalIKBridge. Atlas looked at the target correctly (see below). For this test I used the exact project that you sent and only changed the FinalIKBridge and LookAtIK component settings.
Please select the headbone and see if it is properly aligning. I can already see his head is aiming next to it just by looking at the image.

1675895303347.png
 
Last edited:
On closer inspection it does look like that's the case. Since the character controller isn't rotating the bones at all I have reached out to the FinalIK developer to see what could be causing it. I'll update this thread as soon as I hear more.
 
H heard back from Pärtel. Here's what he said:

LookAtIK samples the pose of the character when it initializes, to find out the forward axes of the bones. It must be that the Animator has already updated by the time and turned the head a bit.

It is also possible to change the forward axes of the bones after LookAtIK has init, with a script like this:

Code:
using UnityEngine;
using RootMotion.FinalIK;

public class LookAtInit : MonoBehaviour {

    public LookAtIK ik;

    public Vector3 spineForwardAxis;
    public Vector3 headForwardAxis;
    public Vector3 eyeForwardAxis;

  
    void Update () {
        if (!ik.solver.initiated) return;

        ik.solver.head.axis = headForwardAxis;
        foreach (IKSolverLookAt.LookAtBone spineBone in ik.solver.spine)
        {
            spineBone.axis = spineForwardAxis;
        }
        foreach (IKSolverLookAt.LookAtBone eyeBone in ik.solver.eyes)
        {
            eyeBone.axis = eyeForwardAxis;
        }

        Destroy(this);
    }
}

This explains why you are seeing different results when the locomotion component is enabled. I will see if there is a way to manually initialize the LookAt component before the Animator is initialized. This way there isn't a need for that workaround.
 
Top