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

I have a 2 handed weapon attached to my character and I am using hand poser interaction to place the second hand. Everything works wonderfully, until I use full body grounder, this then full body IK does not recaclulate the hand poser position based on how ground adjusted the body position. Is there something I can do to have the grounder reposition be effected before the hand poser interaction?

Hi Partel,

I have been reading a few things about Photon in this forum, and I stumbled across a post you wrote about 2 years ago.

So, that was written a while ago, did anything change? Should I still try the way you suggested? I know you were using Photon 1 instead of 2, but besides that, anything important?

What’s the “ik.solver” in the code?

And when you wrote empty gameobjects assigned as IK targets in VRIK that shouldn’t parent to the root of the character, did you mean something like this? So it means I would have to set the positions and rotations of the the empty GOs as the same as the controllers and headset and then assign the empty GOs as VRIK targets?

And also that means I would have to put the character and the empty gameobjects all inside another gameobject, so then I can prefab and instantiate them, correct?

Dude, I still can’t believe I managed to release a VR game in a year ;D
Thanks man,
Gabriel.

can this asset be used on ai with multiple colliders?

@Partel-Lang , is this thread deprecated?

Hey,
The only way to have all avatars have the same height would be to raise the tracking space for shorter guys and lower it for taller ones. Basically adjust tracking space height offset so that camera matches the avatar’s eyes.
Then they would all appear equal, but the downside is that shorter guys would not reach to pick up stuff from the ground and the opposite for taller guys - they would find virtual ground closer than their actual floor.

About picking objects up, you could just parent the object to the avatar’s hand bone, play an animation of a grabbing hand pose to match the fingers to the object.

Hey,
No, don’t think anything changed since that time, should still work like that. “ik” in the code is a reference to the VRIK component and ik.solver is the VRIK solver nested in the VRIK component.
About the empty gameobject stuff, yes, your screenshot looks right (if this is the remote instance of the character). “headIKTarget” in that screenshot should be the headIKTargetProxy in the code.

Hey, sorry, could you be more specific please, which colliders were you talking about?
Final IK doesn’t really care about colliders, it does IK on the bone level, just rotating some bones basically.

Hey,
No, I normally don’t reply on weekends, sorry, got a family. Sometimes requests pile up too and takes a while to get back to everyone, what you see here is just a tip of the iceberg so to speak.

Cheers,
Pärtel

Yeah, he replies constantly, don’t worry =)

Hello
I am just getting to grips with Puppetmaster & FinalIK however Im really struggling with implementing Hit Reaction script for a combat game. The demo only uses raycast as opposed to colliders. I have tried to adapt but I just cant get it to work. The HitReaction is called on the collider that is placed on the head of the puppet, the OnCollision checks for limbs that may have collided. The part of the body that has been hit is the part I need the reaction for, in this instance the head

void OnCollisionEnter(Collision col) // col is the fist thats colliding

hitReaction.Hit(GetComponent(), dir * hitForce, col.contacts[0].point);

I know a few have asked for this before and I would love if anyone can help me. I just want colliders to activate the HitReaction script as opposed to raycasts

Thanks

5843839--620536--Capture.JPG

Hey @Partel-Lang . I set up my avatar using the VRIK Locomotion Scene you sent me to last week. The problem is, it jitters like crazy! How can I smooth the hands, so they looks natural?

Another question- I’d like to “mimic” another IK rig, but at a different scale. is that possible? in VRIK i mean, to have one IK rig sized properly, and another, larger stationary IK rig, like a robot or a mech, mimicking the motion.

Similar to what i did a few years ago with my mocap suit here:

Hey,
If you already have a PuppetMaster rig, why do you need Final IK’s HitReaction? That is just faking hits with IK. PuppetMaster should resolve the collisions automatically. Might need some tweaking in BehaviourPuppet, like reducing collision resistance.

Hey,
Was the demo that I sent you already jittering or did you change/add something and then it started to jitter? Asking because I can’t see the jitters here. What do you have for Update Mode in Animator?

Hey,
Here you go:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using RootMotion.FinalIK;

public class CopyPastePose: MonoBehaviour {

    public VRIK ik;
    [Tooltip("Copy Pose From")] public Animator copy;
    [Tooltip("Paste Pose To")] public Animator paste;

    private HumanPose pose = new HumanPose();
    private HumanPoseHandler copyHandler;
    private HumanPoseHandler pasteHandler;

    private void Start()
    {
        // Construct handlers
        copyHandler = new HumanPoseHandler(copy.avatar, copy.transform);
        pasteHandler = new HumanPoseHandler(paste.avatar, paste.transform);

        // Register to get a call from VRIK after every time it updates
        ik.solver.OnPostUpdate += AfterVRIKUpdate;
    }

    // Called by VRIK
    void AfterVRIKUpdate()
    {
        // Copy
        copyHandler.GetHumanPose(ref pose);

        // Paste
        pasteHandler.SetHumanPose(ref pose);
    }
}

Requires both to be Humanoids though.
Cheers,
Pärtel

@Partel-Lang I didn’t have a chance to figure out the jittering, cause I noticed this happening randomly. I changed the model, but copied all the configurations, so I don’t understand why it’s floating above the ground. It’s fine while I’m sitting, but it’s floating when I stand. Imgur: The magic of the Internet Also, I don’t know whether it’s related, and I can’t replicate it, but on my testers’s computer, he falls through the floor on a scene change. I don’t change anything in the body’s configuration, but in the Main Menu, it’s fine, but in any other scene, he falls through the floor. This does not happen for me.

Sorry one last question, does it matter which gameobject gets this script?

@Partel-Lang Hi, I’ve been using VRIK and it works amazingly! But I am having trouble with the hand targets when holding a gun with two hands.

Right now I am parenting the gun to the right hand bone of my character (driven by the VRIK right hand target), and then setting the VRIK left hand target’s position to the gun’s handguard.

My code looks something like this:

        private void Start()
        {
            VRIK.enabled = false;
            Gun.transform.parent = RightHandBoneTransform;
        }

        private void LateUpdate()
        {
            VRIKLeftHandTarget.target.position = Gun.Handguard.position;
          
            VRIK.solver.Update();
        }

But the left hand begins to lag behind the gun when the character moves, as shown in this video:

Is there a better way to set the position of the VRIK left hand target, so that it does not lag behind? Is it lagging behind because the actual gun is parented to my character’s right hand bone, so the gun’s handguard position is out of date until VRIK.Solver.Update() is called? Just to be check, I did try calling VRIK.Solver.Update() before AND after the left hand target position was set, but I still have the lagging issue.

The movement of the character is done in Update(), and I am simply moving the parent transform of the right hand target, left hand target and head targets.

Any suggestions? Thanks!

Hey @Partel-Lang , I have a problem where the player falls through the floor. It seems to happen whenever the controllers or headset aren’t “awake” when the game loads. How can I make that not effect the VRIK body?

Hey,
If the feet float, it might be that the avatar is just too short for you. If it only happens when you look down, please try reducing the values of “Neck Stiffness” and “Body Rot Stiffness” in VRIK Spine settings.

About the jitters, could be the controllers updated after VRIK updates. If you are using SteamVR plugin, find the “SteamVR Settings” scriptableobject in the project, set “Input Update Mode” to OnUpdate and “Pose Update Mode” to OnLateUpdate. If they use OnPreCull, then your controllers are updated after VRIK to reduce latency, but then you’ll see the hands jitter relative to the controller mesh.

If you use TrackedPoseDrivers, set their “Update Type” to “Update”.

No, it does not matter.

Hey,
How and when exactly are you moving the parent transform of the right hand target?

Try moving the code that handles the right hand target to the same place where you set left hand target to make sure they are in sync.

Hey,
VRIK never moves the root of the character vertically, so it must be something else making it fall, probably a physics issue. Not sure without seeing the project.

Cheers,
Pärtel

@Partel-Lang I hate to keep pinging you, but I’m not too good at adapting to new assets. I’m trying to use VRIK with Photon PUN. For some reason, even tho I have a Photon Transform View component on both characters, only client A (i don’t know the order, just labeling for clarity) sees the client B moving. Client B doesn’t see Client A moving.

Hi Pärtl,

I do have two questions regarding your current IK package:

  • Is it recommended to use the TwistRelaxer only when there is a twist/roll bone between the wrist and elbow? I could not find a configuration which relaxes my wrist twist, it just moves the twist problem to a different bone (elbow or even shoulder, depending where I apply the twist relaxer).

  • Is there a way to run a body part IK on the head similar to LegIK and ArmIK to adjust only the head position (and of course the related chain)? I would like to use this to perform a end effector adaptions when the head need to be in a particular position after applying a body pose retargeting.

Best,

Erik

Also, Partel, I was wondering how I would go about making a two-handed grip on a gun in VR? What parents to what, etc? Also, does Final IK have something that will help with finger positioning? I plan on having the gun held the entire time, so I don’t need to worry about dropping, picking up etc. I do plan on having weapon switch-outs tho. So I either need two different hand poses, or I can figure out how to make do without precise finger placement.

Hi, can you post the code that you’re using and maybe pictures of your setup? I’m currently studying that, so I might be able to help, and if I can’t, Partel will be able to help better if he has more details.

Maybe Final IK has an option for that, but I believe Spring Joint or Fixed Joint might work pretty well for that and super easy to setup.

Gabriel.

Can you expand please?