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

Hi Pärtel,

I’m looking to create a robot arm sort of thing, and have been having problems implementing my idea.

I’m trying to make a robot arm that mimics the positioning of a VR controller (rotation and position), and my idea to create this solution was to have there be two targets, one where the “wrist” would be, (just a point directly behind the grab-able object) and one where the “claw” would be.
The end goal would be to have a robot that can pick up, rotate, and move objects, all while having joints only move one rotation axis. So far, I’ve only seen IK examples that ignore the rotation of the target.

For example, if there were 5 joints, the first three joints would find and track the position of the wrist, and the other two joints would track the claw, enabling the claw to rotate/reposition objects.
I’ve tried to use some of your systems, but cannot find a cohesive solution to the two-target implementation.

Using this package, I’ve created some sorts of robot arms trying to combine different IK systems, (like one IK system to the wrist, then another IK system from the wrist to the fingers) but they either glitch out, track poorly, or certain joints fail to rotate on one axis.


7461574--916066--gif.gif
This is a rough test of what I currently have using aimIK, where the blue sphere is the first target, and the yellow is the second target. (I assume aimIK isn’t the best solution to a problem like this, but its the one that worked out the best so far)
What I’d like to have is the blue sphere being tracked as well as the yellow.
With the red arm/line to line up with the yellow target, aligned with the darker line like this:

With my current implementation, the yellow sphere isn’t being intersected correctly when rotating, and also comes with tons of strange movements of the arm when moving the targets around. I think the problem has to do with me using two IK systems, and them interacting badly with each other. Everything up until the wrist works fine.

So, my question is, is there somewhere in this package that would allow me to easily track two targets like I described? Or, if not, how would you go about implementing an IK system to track the target’s rotation?

Thanks!

Hello Pärtel,

I export character FBX from DAZ to Blender and then into Unity. And Blender messes knee rotations, so they bend opposite direction or to some random angle. I saw your video tutorial how to fix it so I open created character prefab and rotate knee in order to get blue arrow pointing forward. Problem is that blue arrow jumps on x-axis in quite a big steps and is almost impossible to make it pointing forward (I can demonstrate it in short video for better understanding).

Is there some other way how to do it? Ideally through code I could put into my custom class for processing FBX.

Hey,
No, unfortunately Final IK is not final enough, solvers that can do that are mostly used in robotics and probably not performant enough for games, which is why I haven’t made the effort to implement them. Hopefully Unity will add inverse dynamics soon to the Articulation Body system. In the meanwhile, I have this package that sets up a PhysX rig to work similar to an inverse dynamics solver, please check it out.

Hey,
Yes, you can just write knee.localRotation = Quaternion.Euler(0, 0, 1) in Start().
Whether the 1 should be on the X, Y or Z axis depends on the bone orientations of the model. Might have to be -1 instead. The point is to have the knee rotated just 1 degree in the natural bending direction.

Best,
Pärtel

[EDIT] Work worked out what this issue was, the elbows were ‘stretched’ out, the Log Warning and red squares were good clues, we just added 1 degree of rotation to fix that and its fine now. :slight_smile:

Hi Pärtel,

When I move the Weight value of the FBBIK past 0.8, the hand with the Aim IK component miss aligns with the animation. Any Ideas?

FYI: I am using an IKEO script to control the order of the components.

  • LookIK
  • AimIK
  • FBBIK

I’m also using the HitReaction and Grounder Components.


1 Like

Hi, I’m trying to attach a gameobject using parent constraint to one of the bones on my humanoid that’s being driven with VRIK. It seems like ‘Fix Transforms’ is not letting the gameobject follow the transforms after the solver has happened. Disabling ‘Fix Transforms’ creates the usual problem of the character climbing to the sky, so I believe it’s best to keep it on. Is there any way around it?

Hey,
The problem is that Unity constraints update before Final IK and there’s no way to change when they update. You can change when FIK components are updated though if you disable the IK components in Start and call ik.solver.FixTransforms(); in Update and ik.solver.Update() in LateUpdate.
Also, here’s a custom parent constraint that runs after IK for you.

Best,
Pärtel

2 Likes

Hi Partel,

I am using Full Body Biped IK to adjust the pose of my character. I assign a transform (let’s call this Handle transform) to the Body Effector, and I can drag this Handle around and the character’s moved as it should. My question is how do I obtain the “neutral position” so I can return this Handle to a position as if IK is turned off? Is there I can obtain the animated position?

Thanks

Hey,
You can just se effector position and rotation weight to 0, then it will have no effect no matter where it is.
But to set it to the animated position/rotation:

void LateUpdate() {
    ik.solver.leftHandEffector.position = ik.solver.leftHandEffector.bone.position;
    ik.solver.leftHandEffector.rotation = ik.solver.leftHandEffector.bone.rotation;
}

Best,
Pärtel

1 Like

Hi @Partel-Lang . We are using FinalIK/VRIK and Puppetmaster in our VR game with the Index + 3 vive trackers but are having some issues with the Calibration controller script I got from this thread.

After loading the game with the trackers connected, we hit the calibration button for the VRIK Calibration Controller script. The feet trackers then appear to become untracked and both are set to the hip tracker.
I inspected the VRIK values, and they are still set correctly, also the steam vr_tracked_object components maintain their correct input assignments. So it doesn’t look like anything is being reassigned within Unity.

Here is a video of the issue. WARNING The audio is loud, please turn off your audio.
gqu7m0
This is our setup below showing the targets for the steam vr_tracked_object assignments.

7496765--923252--upload_2021-9-14_22-3-29.png

We did not perform any major modifications to the Calibration Controller script, do you have any idea what might be wrong here?

Thank you.

I purchased this Asset a while back and I’m finally getting around to using it. I’m sure you get this a lot, but this is one of the best assets in the store and you, sir, are a genius! It’s just totally awesome! Thank you so much!!

Hey @Partel-Lang ,

Hope you don’t mind that I cross-posted this to a support ticket on Root-motion.com first before finding this thread.

I have a compound Character (Biped “wearing” an Exoskeleton rig) I am trying to make into a VR Avatar that is set up using the Unity Animation Rigging Package. Basically its an Exoskeleton that the biped is wearing, that should track along with the movements. (The Exo has a bone connecting at the hip and constraints at the hips, knees and balls of the feet).

When I add VRIK to the character, the Animation Rigging constraints get “muted” and the exoskeleton no longer follows the character.

I’m really noob at rigging so please let me know if this is even the appropriate way to accomplish this or if there is some incompatability with the new Unity rigging System I should be aware of,

Thank you and Thank you for making such a great asset, we’ve enjoyed using it!

Hey, sorry for the wait!
I have no idea actually, haven’t seen that before. But looking at your targets hierarchy, I don’t see the hands there, are the hand targets parented to the index controllers like they should be or are they in the mixamorigHips(1) hierarchy?

Hey,
Thank you for the purchase and for stopping by to say some kind words, much appreciated! :slight_smile:

Hey,
Replied to your support ticket…

Cheers!
Pärtel

No problem, thank you for the response. I apologize, I should have included that in the original post.

The controllers are here in the original CameraRig that gets created when we initialize the SteamVR project.

The Targets are in a separate object seen below. Did I set this up incorrectly?

7518764--927539--upload_2021-9-23_16-18-44.jpg

Hey,
Looks correct, but not sure how I can help debugging it from here. Can you pause the scene after calibration, then click on each IK target’s position? If they are where they are supposed to be, but the pose looks wrong (doesn’t match the targets), then it’s a problem with the solver or the calibration. If they are at the wrong positions, then it’s something with the tracking and SteamVR stuff.

Best,
Pärtel

Hello, I am using VRIK. My physical body is following my XR Rig (head and both arms) and copying its movements. I have locomotion weight set to 0 and am able to animate the legs this way (so when I move with thumbstick the legs play the correct animation). I tried to play a crouching animation and realized it doesn’t work because the XR Rig head and arms don’t decrease in height with the animation (which is the expected functionality).

Here is my question/thoughts. When I play a crouch animation the legs bend to crouch but the upper body doesn’t go down because they are trying to follow the XR Rig. Is there any way for the XR Rig to realize the legs are bent and lower itself to match the animation? I realize I could hardcode a standing and crouching height but was wondering if there was something built in that could accomplish it.

Hey,
You can lower the head, but since it’s supposed to follow the HMD, in first person you’d get an out of body experience, seeing your own head from above.
If it’s an avatar of another player (in a networked situation), then it is sometimes good to inherit some vertical motion from the animation, for example with animated locomotion, having some head bob carry on from the animation looks much more realistic than having the head perfectly locked to the HMD.

Add a new empty child gameobject to what you currently use as head IK target, assign that new object to VRIK as head target instead. Then use this bit of code:

void LateUpdate() {
    Vector3 HMDPos = ik.solver.spine.headTarget.parent.position;
    Vector3 animatedHeadPos = ik.references.head.position;
    ik.solver.spine.headTarget.position = new Vector3(HMDPos.x, animatedHeadPos.y, HMDPos.z);
}

That will make the head target follow the HMD horizontally (so you can still lean), but animation vertically.

Best,
Pärtel

1 Like

Hey all, I released an interaction handler tool for IK (Actually for Final IK). In the editor, it takes just two clicks to create new interactions. In runtime, it has similar rules for the interactions but for IK body parts instead of objects.

It is better to watch so here is the trailer for it:

1 Like

Hello, I am having an issue where my vrik body lags behind me when I move using the thumbstick. The root character gameobject has a rigidbody and two child gameobjects, the XR Rig and the vrik body. I use rigidbody.MovePosition to move my root character. Not exactly sure why the vrik body is falling behind (example video below)

Hey,
Can you parent little cube objects to the hand controllers to see if they lag too? If they do, then it is something other than VRIK causing the issue. VRIK always reaches it’s targets (provided they are in reach) 100% within a single update step.
Do you have any physics set up for the hands?

Best,
Pärtel

Hi again, I’m trying to synchronize multiple humanoid characters with a single VRIK. All of these characters have identical bone hierarchies, the only difference are their renderers. I’ve tried making empty gameobjects with transform and rotation constraints set to the actual trackers, and they work as intended, but there are always slight differences between each of them because of factors such as locomotion timing between steps and position. Thanks as always.