Search Unity

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

Discussion in 'Assets and Asset Store' started by Partel-Lang, Jan 15, 2014.

  1. ubergeekgames

    ubergeekgames

    Joined:
    Oct 1, 2016
    Posts:
    32
    Hi there,

    I have a fully rigged and animated quadrupedal character. Leg IK is working wonderfully for the limbs! Trouble is I'd like to add an IK system on the spine that works in the opposite direction of the bones. None of the IK scripts appear to support this configuration, and give me this error:

    "Invalid/incomplete setup, can not initiate the solver. Invalid bone hierarchy detected. IK requires for it's bones to be parented to each other in descending order."

    Is there any way around this other than rerigging and reanimating the character?
     
  2. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,965
    Hey guys, I'm back! Thanks again for your patience!

    Sorry, not sure, could you paste the code you were using?

    Hey,
    The reason is mostly related to optimization of the solver. It's possible to set up custom effectors to rotate the body and spine though, please see the "Offset Effector" demo.

    Hey,
    No problem with Unity 2019. I will update the package soon to make sure there are no import warnings and stuff like that, but for now Unity auto-updater can manage it fine.

    Hey,
    I didn't notice flicker in that video, probably because of the frame rate. Can you turn down the time scale to something like 0.1 and record again please? Or send me that character and animation fbx so I could see for myself.

    Hey, thanks for the purchase!
    They are completely different things. UMotion is a tool for authoring animation in Unity, Final IK is for making realtime procedural adjustments to the animation to make it match the dynamic game environment. Final IK can run on animations created with UMotion just the same, so no problem there with integration.

    Hey,
    The next version of VRIK will have a LOD option for VRIK. LOD level 0 is normal, 1 saves about 30% and 2 is VRIK almost disabled with just moving the character root if you have locomotion weighed in. If you are in a hurry, please send a PM with your invoice number.

    Hey,
    If you set locomotion weight to 0, the legs will be free to follow the animation, but IK will still be solved on them, because the body position and bend needs to be adjusted to make the head match the HMD.
    Tip toeing usually happens when the avatar is too small for the player. You could adjust some spine settings, like reducing "Neck Stiffness" and "Body Rot Stiffness" so it would not bend the spine too much when looking down. Also try disabling "Plant Feet" and adding a "Stretch Curve" to the leg settings could help too. To get a good optimal value for that, please go to the "VRIK (Basic)" demo and copy the stretch curve over from the Pilot's leg settings to your own.

    Hey,
    CCD and FABRIK solvers require a descending hierarchy like this:
    - pelvis
    - spine1
    - spine2
    - chest
    You can skip some bones in the hierarchy, but it can't be the other way around or any bones from another hierarchy branch like arm or leg in between.

    Cheers,
    Pärtel
     
    seanybaby2 and JoeStrout like this.
  3. IIOIOE

    IIOIOE

    Joined:
    Nov 8, 2018
    Posts:
    1
    Hey Mr. Lang :)

    Thanks for all the quick help youre doing here, I am really glad youre so committed to that.

    I am currently working on my bachelor thesis, doing a VR-application with a body-based interface on the forearm.
    My evaluation will be this Friday, and unfortunately some things really get me frustrated, because time gets close and these functions are important. I hope you can help me.

    I've read through the 78 pages of this Thread and found some solutions maybe, but I am still not hundred percent sure. So I hope you can help me.

    First Problem:
    My interface is placed on the left forearm of the dummy-model. When I'm rotating the hand, naturally the forearm should rotate a lil bit, so the interface moves and rotates with the arm. But I can't accomplish the forearm rotation.
    Is it just the twist relaxer on the forearm, thats doing all the magic of rotation when the hand rotates?
    I've read that I just have to put the Dummy as reference and the shoulder as well as the Hand get assigned automatically and then my forearm rotates. Is that right ?

    Second problem:
    My dummy is tiptoeing when Im looking down.
    I've read that I just have to play around with the Body Rot Stiffness and Neck Stiffness, and copy the Stretch Curves from the Pilot demo. Also I've put the Calibration Controller Script into my scene to calibrate the player height first when starting the application. Is that really all ? Scaling the Player height and just play with the Stiffness parameters?

    Third problem:
    It seems that when I am wearing the HMD and look at my body, that the head stucks in the throat of the Model?
    This is bad, because I need to look accurately at my forearm and upperarm to interact with my interface.
    How can I achieve, that the head is higher so it looks that youre really looking through the eyes and not the thorat ?^^
    Is it just the scaling (Calibration controller) thats doing the magic to solve this, or do I have to change something else?

    Fourth problem:
    When I stretch my arms it doesnt fit the actual model, so the controllers fly in the air and the arms are way behind them. Do I solve this with the calibration Controller?

    Muuuuch thanks for your help. I hope you can help me <3

    Greetings
    Rave
     
  4. Politician

    Politician

    Joined:
    Apr 27, 2019
    Posts:
    5
    Sorry for being persistent but can you please look at this part of the video again (720p60fps or 480p30fps available) on the character knees. Idk what to call it so described it as flickering. Just wanted to know is that alright behavior or not because It's just some mocap animation from a pack and a deafult avatar for it so they should fit perfectly.
     
  5. seanybaby2

    seanybaby2

    Joined:
    May 17, 2013
    Posts:
    108
    Fantastic news! Thank you.
     
  6. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,328
    I need some advice on how to make my FinalIK-driven avatar properly interact with physics objects. You can see the problem here:



    I've put colliders (and even a kinematic Rigidbody) on the hand/arm, but instead of pushing the blocks in the proper direction when it collides, it just intersects them, which the physics engine resolves by moving the blocks up/down in a most unrealistic manner.

    Is there any option or trick to make FinalIK interact better with physics objects? Some way to make it move the body parts with Rigidbody.MovePosition and .MoveRotation, perhaps?
     
  7. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,965
    Hey,
    1) Did you try adding TwistRelaxer components on the forearm or forearm roll bones if you have them? Like in the "VRIK (Twist Relaxers)" demo.

    2) Yes, that should do it hopefully. Neck Stiffness and Body Rot Stiffness control how much of the rotation of the head is carried on to the spine. If neck is too stiff, looking down would bend up the spine too, lifting the pelvis and causing the tip toes.

    3) You'll probably need to adjust the local position of the head target. If you were using the calibrator, then in the "VRIK (Calibration)" demo you can do it by just moving the "Tracker Mock (CenterEyeAnchor)" gameobject (the green thing in front of the eyes representing the HMD).

    4) Sounds like the avatar's arms are just too short for you. You can scale them up by increasing "Arm Length Mlp" in the arm settings and/or adding a stretch curve to the arm settings (can copy from Pilot in "VRIK (Basic)" demo to get a good optimal value).

    Hey,
    It's probably that in the animation clip, at the time when the leg is completely stretched out, the thigh twists a bit and that is not visible normally, only if IK bends the knee, it will be accented. If you could send me that character and running animation fbx, I will take a look and see how it can be fixed. Might take a little fiddling with the knees in the avatar configuration scene if it's a Humanoid. Or enabling "Foot IK" in Animator for the locomotion clips sometimes helps...

    Hey,
    With animation it would be just switching to AnimatePhysics mode to fix it, but even with that, IK will still have to be applied later in LateUpdate, because I can't update FBBIK together with the Animator in Unity. The only solution I can see would be to make a duplicate of the character, get rid of the colliders and rigidbodies on the original and delete all non-rigidbody gameobjects in the duplicate hierarchy. Then make the duplicate move via MovePosition/Rotation, move each rigidbody to the position/rotation of their counterparts in the original hierarchy. If you already have PuppetMaster, you could also just set the character up as a puppet which will give you more options.

    Best,
    Pärtel
     
  8. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,328
    I don't think I understand you here. There is no animation involved in this case; I'm moving the character purely with FBBIK.

    I was thinking about something like that as a fall-back plan if there is no simpler solution.

    Thanks for pointing that out, I hadn't seen it before. I think it may be overkill for our needs, but it's certainly something I'll keep an eye on.
     
  9. Michael_R

    Michael_R

    Joined:
    Sep 6, 2018
    Posts:
    29
    I've made a video about the problem.

    https://youtu.be/puEkfr7nLJI

    The limb Ik is totally working with the palm as the end effector. But when i mark the grip points-effector with spheres in the gun, it will break my animation.
    I just want to have it like you see in the Video but with the gun as the end effector

    how it should looks like at the end:

    https://www.youtube.com/watch?v=baCRowsIZ5Y

    https://youtu.be/FblYGjsCqYE?t=1087

    p.s. I know the gun is parented to the palm (effector), but is it possible like that?


    Best regards
    Michael
     
  10. Glader

    Glader

    Joined:
    Aug 19, 2013
    Posts:
    402
    This is good news. Can we see benchmarks/profiles of this in action with quality comparisons? This is something that could dramatically impact the viability of a large amount of nearby FinalIK rigs in a networked game. This plus the aforementioned multithreaded rigs that scale better is such good news!!
     
  11. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,965
    Hey,
    What I meant by that animation thing, is just that if your character was moving just by animation, it would not be an issue, as with Animate Physics mode, Unity updates the Animator within the physics update step and friction and collisions will be properly applied. But it doesn't help us here anyway, because Animator does not give us a call when it is updated (something I have requested from Unity devs multiple times).

    Hey,
    Sorry, your video links are broken or private..

    The real gain depends on the device you run it on and how many characters you have and so on. In Editor, deep profile (not very accurate) shows about 25% improvement on a single character. LOD level 1 basically just disables shoulder solving, stretching, simplifies spine solver, disables Plant Feet (makes leg solvers solve multiple times). It looks very close to LOD 0, with just a bit of a snap in the shoulder and chest area.
    LOD 2 disables the entire solver, just updates root position if locomotion is used. If you wanna give it a try yourself, please PM me with your invoice number.

    Cheers,
    Pärtel
     
  12. Michael_R

    Michael_R

    Joined:
    Sep 6, 2018
    Posts:
    29

    @Partel-Lang Here is the link (forgot to turn off mic heheheh):

    My state (with problem):


    How it should look:



    My questions are,
    is it possible to have an effector which is subordinated to my rh_palm (third bone at limb ik) like for example for the gun?

    How can i change the effector target position when no has been set via script (like you see in the video) with an additional script?
     
    Last edited: May 14, 2019
  13. josterday

    josterday

    Joined:
    Jan 22, 2018
    Posts:
    51
    Few additional questions about VRIK Calibration:

    - We applied Steam VR_Tracked Object script to each of the Green Mock Trackers in the demo scene. Do we need to reposition them during Runtime as well as do a proper T Pose (fit into Pilot)?

    - At Runtime, our trackers appear all over the scene compared to the other demos where they only require minor tweaks to get the positioning right.

    - Which direction should the trackers be facing when mounted? (aka which direction for the LED's)

    - Is it possible to set this up with a tracker for the head instead of HMD?

    Thanks
     
  14. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,965
    Hey,
    If you need to have it like the second video, you'll need to unparent the weapon from the right hand, parent it to the root of the character instead, then parent the IK targets of the left and right hand to the weapon. If the weapon is a child of the IK rig, you'll have a circular dependency and the IK will be like a dog chasing it's tail.

    Hey,
    You'll probably have to unparent the green objects from the Pilot, the Pilot is used just to mock the player wearing the trackers. You don't need to be in proper T-pose to calibrate, standing up straight is fine, arm pose is not important.
    The direction of the trackers can be defined in VRIKCalibrationController with the Head/Body/Hand/Foot Tracker Up and Forward vectors.
    You should be able to use a tracker instead of the HMD, just need to define Head Tracker Forward and Head Tracker Up according to how you wear the head tracker.

    Sorry I don't have a demo where you can just plug in SteamVR trackers, as I don't have them, that calibration tech was designed with another custom mocap system.

    Best,
    Pärtel
     
  15. andrew210

    andrew210

    Joined:
    Apr 23, 2014
    Posts:
    158


    Hi there! Wonderful asset and am really enjoying getting to grips with it. I'm wondering if there is any way I can make an Interaction Target movable. In the video, when the focused on button is pressed, the interaction targets position is changed to be infront of the button pressed before the interaction is started. However there would appear to be some Final IK wizzadry that doesn't allow for the local position of the interaction target to be moved? Is there anyway around this at all other than having a different interaction object / interaction target for each button? Thanks again for the asset, it's amazing.
     
  16. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    143
    Hello
    I started use the lookAtIK for the character look at the NPC or object, but how i implement is not good. changed the weight when character are close to npc (the change is to abrupt or fast) there is another form to do that?

    thanks

     
  17. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,965
    Hey and thanks!
    Can't think of anything in Final IK that would lock the position of the interaction target. Tried it myself in the "Interaction" demo, played the scene, then adjusted the position of the hand targets parented to the Button there and it seemed to work, didn't see them being reset. Any other way I could try to reproduce the issue here?

    Hey,
    Not sure without seeing the code you use for changing the weights and target positions.
    Anyway, please check out the "LookAt Controller" demo. LookAtController.cs is a helper component for LookAtIK that takes care of all the weight blending and target interpolation stuff for you, so all you'd ever need to do is set LookAtController.target to whatever you want to look at and set it to null if you need to disable it.

    Best,
    Pärtel
     
    claudius_I likes this.
  18. andrew210

    andrew210

    Joined:
    Apr 23, 2014
    Posts:
    158
    Thanks so much for such a quick response. Continued to investigate after and appears obvious when I actually looked properly. "Fix Transforms" on Hand Poser appeared to be whats stopping it from moving ever, unticked that and then worked great. Thanks again!
     
  19. teighshiclbw

    teighshiclbw

    Joined:
    Jun 26, 2018
    Posts:
    34
    Hi, Partel!

    I am tring to use Final IK on some slide animations which character can aim 360 degree.

    When characte shoot, his hand will slighty lift up, because gun is hand's child object, so gun also lift up.
    I want to keep this lift up when using Final IK.
    Normally I will just use aimIK.solver.axis = aimIK.solver.transform.InverseTransformDirection(transform.forward);
    When character's gun point to forward, this work.
    I called it AimDirection.

    But I got diffrent slide animations, one aim at forward, one aim at left, one aim at right, one aim at up, one aim at back.




    Their AimDirection is diffrent, so transform.forward not work anymore, for smooth result, I need to blend these animations in a BlendTree, so dynamiclly switch to transform.up or transform.right not work too.

    I tried to use a bone(slot001) to indicate AimDirection, make this bone look at gun-aim-direction in 3ds max. Thus BlendTree will also calculate it when blend diffrent animations.Then I can read this bone's direction, and make it become AimDirection, but result still not looks good.

    Character's gun still can not point to target accurately.

    The only way I know is to remove aimIK.solver.axis = aimIK.solver.transform.InverseTransformDirection(transform.forward);
    Gun will aim at target accurately, but it's also looks like locked with target.


    When character shoot, I want his hand lift up, but instead, his hand rotate down, because Final IK still try to make gun aim at target.


    Hand lift up, but not aim accurately.

    So I need gun aim at target accurately, and when character shoot, I want his hand lift up.
    How can I accomplish this?

    Here's project file(No Final Ik included of course):
    http://www.mediafire.com/file/7gzw6466uza95xv/IKTest2%282%29.rar/file
    Thanks!
     
  20. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,965
    Hey,

    Please import this package to the project you sent me (backup before you do).

    Before we start with IK, we need to make sure that the animation playing underneath blends nice and smooth. It is not possible to create a smooth 3D aiming blend tree with 2D blend trees. Thankfully we have the Direct blend tree type available in Mecanim, I have edited the animator controller and the CharacterBehaviour script to show you how it can be used.

    It will be much smoother and more accurate than the 2D blend tree, but we still can not accurately calculate that animated aim direction. Because of the blending, at some angles the left and right arm even aim at different directions. That's why it would be much easier to do the recoil procedurally on top of AimIK by just rotating some bones. I have made an example for you in the scene, but I'm sure you'll get better looking results if you tweak the Recoil Offsets values a little bit.

    Another possibility would be to get the world space direction of the hand bone's forward pointing axis (leftHandAnimatedAimingDirection) from LateUpdate and use it for leftHandAimIK.solver.axis = leftHandAimIK.solver.transform.InverseTransformDirection(leftHandAnimatedAimingDirection);
    But only do that when the recoil animation is not playing, just skip calling that line while it is.

    Best,
    Pärtel
     
  21. NikkiC5

    NikkiC5

    Joined:
    Jun 11, 2016
    Posts:
    9
    Hi,

    I've just imported FinalIK into a Unity project. It immediately gives the error "CheckConsistency: GameObject does not reference component Animator. Fixing.". What is this and how can this be resolved, as it seems unusable in this state?

    [edit] Ok, I reloaded the project and the message has disappeared. Looks like a one-off glitch.
     
    Last edited: May 21, 2019
  22. teighshiclbw

    teighshiclbw

    Joined:
    Jun 26, 2018
    Posts:
    34
    Again you save my day, sir! Can't thank you enough!
    Yes, Direct looks much better than 2d BlendTree.
    Procedural Recoil is a good idea, but I am tring to keep animation recoil if possible.
    I just realize I can disable shoot layer to get the correct gun-aim-direction, no need care shoot animation playing or not.
    Code below can keep hands lift up when shoot, and make gun aim accurately.
    It has some performance problem since animator need to update 2 times,but result looks good enough.
    Code (CSharp):
    1. void OnGunNotLockToTarget()
    2. {
    3.     int SHOOT_LAYER = 1;
    4.     animator.SetLayerWeight(SHOOT_LAYER, 0);
    5.     animator.Update(0);
    6.  
    7.     Vector3 spineAimIKOriginalDirection = spineAimIK.solver.transform.forward;
    8.     Vector3 leftHandAimIKOriginalDirection = leftHandAimIK.solver.transform.forward;
    9.     Vector3 rightHandAimIKOriginalDirection = rightHandAimIK.solver.transform.forward;
    10.  
    11.     animator.SetLayerWeight(SHOOT_LAYER, 1);
    12.     animator.Update(0);
    13.  
    14.     spineAimIK.solver.axis = spineAimIK.solver.transform.InverseTransformDirection(spineAimIKOriginalDirection);
    15.     leftHandAimIK.solver.axis = leftHandAimIK.solver.transform.InverseTransformDirection(leftHandAimIKOriginalDirection);
    16.     rightHandAimIK.solver.axis = rightHandAimIK.solver.transform.InverseTransformDirection(rightHandAimIKOriginalDirection);
    17.  
    18.     spineAimIK.solver.IKPosition = aimTarget.position;
    19.     leftHandAimIK.solver.IKPosition = aimTarget.position;
    20.     rightHandAimIK.solver.IKPosition = aimTarget.position;
    21.  
    22.     spineAimIK.solver.Update();
    23.     leftHandAimIK.solver.Update();
    24.     rightHandAimIK.solver.Update();
    25. }
     
  23. DevelopedReality

    DevelopedReality

    Joined:
    Jul 14, 2015
    Posts:
    22
    Hey Pärtel,

    Hey @Partel-Lang ,

    Got sidetracked getting the VR wings & flight mechanics to work with my bird (actually switched to a butterfly), which has been a lot of fun. Anyway, I'm now trying to get the body and legs to work using the same basic setup of your Dog demo. So, ideally, I'll use FABRIK to have the wings controlled by the hand controllers and the head, body and 4 legs controlled by the HMD with that customized Dog quadruped setup (butterflies only really use 4 legs to walk/stand so works better than it may sound for an insect).

    Getting the body to follow the transform of the HMD is working well, but I'm not sure how to get the legs to "walk" rather than slide along the ground plane when I move the bite target (or the HMD when setup for VR). I know that VRIK component has a procedural locomotion solution for shuffling the feet around a few square meters. That is all I really need for this--is there a way to incorporate that (or something comparable) with that customized Dog quadruped setup? Or should I be looking at blend trees as in the Grounder demo scene w/ the wolf?

    Thanks!
    Kai
     
  24. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,965
    Hey,
    I've seen that error when Unity automatic updater updates Final IK, but haven't seen it break anything. Likely you have downloaded FIK from a previous version of Unity and using that same package in a newer Unity. Asset Store has a version of FIK for each major Unity version.
    Usually when people import FIK to an existing project and some of the demos break, it is just because of the different Layer Collision Matrix in that project.

    Hey,
    Sounds like a pretty complex rig hehe. I don't think the locomotion module can be taken out of VRIK very easily to be used with other solvers. Maybe the locomotion could be done like in the "Mech Spider" demo instead? I haven't tried using that with 2 or 4 legs, might take some changes to MechSpider.cs and MechSpiderLeg.cs.

    Best,
    Pärtel
     
    DevelopedReality likes this.
  25. teighshiclbw

    teighshiclbw

    Joined:
    Jun 26, 2018
    Posts:
    34
    Hi Pärtel!

    Look At IK not support Rotation Limit.
    How could I accomplish similiar things?
    For example,I dont't want to limit head rotate up and rotate left, I want to limit rotate down in 30 degrees and limit rotate right in 50 degrees.
    Clamp is not suited in this case, since it just like disable Look At Ik when exceeded some angles.
     
  26. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,965
    Hey,
    Please use AimIK for that. It can be set up to work pretty much the same as LookAtIK, only it supports RotationLimits and also has a Pole Target should you need that too.

    With RotationLimits on AimIK, you might run into a problem with the limits clamping the range of motion in the animation. If that happens, add this code:

    Code (CSharp):
    1. public RotationLimit[] rotationLimits;
    2.  
    3.     void LateUpdate()
    4.     {
    5.         foreach (RotationLimit r in rotationLimits)
    6.         {
    7.             r.SetDefaultLocalRotation();
    8.         }
    9.     }
    That will default the rotation limits to their current animated localRotation each frame. Don't forget to assign all the limits used by AimIK to the rotationLimits array.

    Best,
    Pärtel
     
  27. DevelopedReality

    DevelopedReality

    Joined:
    Jul 14, 2015
    Posts:
    22
    Hey,
    Sounds like a pretty complex rig hehe. I don't think the locomotion module can be taken out of VRIK very easily to be used with other solvers. Maybe the locomotion could be done like in the "Mech Spider" demo instead? I haven't tried using that with 2 or 4 legs, might take some changes to MechSpider.cs and MechSpiderLeg.cs.

    Best,
    Pärtel[/QUOTE]

    @Partel-Lang: Thanks--will give that a try!
     
  28. Mikekan13

    Mikekan13

    Joined:
    May 30, 2015
    Posts:
    72
    I just noticed a strange issue. Using VRIK puppetmaster and final ik I have noticed that If I have multiple puppets in a scene then my puppet stutters when I move. If it is just the player that is present then the stutter isn't there. It isn't a framerate issue as im running at 90fps and it when only adding one additional puppet it starts this behavior.
     
  29. unity_3drapidsolutions

    unity_3drapidsolutions

    Joined:
    Nov 18, 2017
    Posts:
    20
    Hi Pärtel!

    I hope all is well with you. I have a few questions about the optimal way to manage weapon holstering/unholstering and two-handed usage during gameplay. I am doing this for the enemy AI.

    So far, I have been able to use your wonderful interaction system to author an animation whereas the right hand grabs the weapon realistically off the chest and then holds it in the hand (using hand poser). However, I have a couple questions about optimal placement of non-dominant hand on weapon.

    (1) To place non-dominant hand, I am simply using an effector to better align the existing 2-handed animation with the actual weapon. Is that the proper way to go about this? Can I use this strategy in addition to Aim IK later down the road?

    (2) In order to author equip and holster animations, I currently put an interaction object (with interaction target hand pose) on both the weapon as well as the holster. I call one interaction object to reach the hand to the weapon and use the pickup() command to grab it. Similarly, in reverse I use the same exact positioning of the interaction target on the holster to move the hand there, and at the 0.5 point I change the parenting of the weapon back to the root to 'holster' it. Is this a performant method? Does it matter that I am using two different interaction objects, as long as I use the same FBBIK?

    (3) I don't understand why the interaction object can have multiple 'events.' Can you describe a use case for this as well as a way that individual events can be chosen via script? Furthermore, the only Messages it seems that the interaction object can send is OnPickUp, is this correct? I understand how a single interaction object can have an event/message/animation pairing for a single use, but I don't understand why multiple events are possible and how they are choosable, especially when they are all limited by the same animation curves.

    (4) How do you access the Vector3 Offset within the OffsetPose script from another script? I can reference the OffsetPose script just fine, but the encapsulation with the interior EffectorLink class is making it impossible for me. I essentially just want to be able to set the Vector3 offset pose dynamically via script, so that I can program in animations via sequential offset positions.


    Thanks!!
     
    Last edited: May 29, 2019
  30. growling_egg

    growling_egg

    Joined:
    Sep 2, 2012
    Posts:
    60
    Hello, thanks for developing FinalIK! I'm interested in a particular use case and wondered if you would be able to suggest a path forward. I'm working on a fighting game, and I intend to use FinalIK to help make my fighting animations look more authentic. I've been watching some videos and testing out the demo scenes, and I have a pretty good idea of how to make a character aim a punch or a kick. I'm concerned that if I give the target character the ability to dodge or block, that FinalIK might cause the attack to be impossible to avoid (since the IK would cause the punch to follow the dodge). Is there a way that I can allow one character to aim a punch at another character's head, but have the second character dodge the punch? Let me know if it doesn't make sense :) Thanks again!

    Edit: Writing this post gave me another thought - would it be possible to use FinalIK to perform the dodge or block? That way the whole fight would be extremely fluid, it would almost look choreographed!
     
    Last edited: May 27, 2019
  31. gliealonso

    gliealonso

    Joined:
    Oct 21, 2018
    Posts:
    16
    Hi Partel,

    I saw on the previous page you helping someone regarding a sword that wasn't very fixed to the player's hand, and I seem to be having the same issues. And then you mentioned additional pin. What is that? I tried googling about it but I didn't see anything regarding that.

    I added that configurable joint to the player's weapon, however I didn't add it as a muscle in puppetmaster, could that be the issue?

    Warmest regards,
    Gabriel.
     

    Attached Files:

  32. jllabelle

    jllabelle

    Joined:
    Nov 1, 2013
    Posts:
    1
    Hello Mr. Lang,
    Do you plan on releasing your version of VRIK working on the Oculus Quest? Can the current version of FinalIK run on the Quest and can we use some of the scenes and demos in sideloaded apps?

    Thank you,
    Jean-Luc
     
  33. schwarz_malerei

    schwarz_malerei

    Joined:
    May 27, 2019
    Posts:
    1
    Hi, I'm using the VRIK version of final IK along with a HTC Vive. It works perfectly fine when I'm using it local, where I can assign all the solvers by using the public fields in the inspector. Since I'm working on a two player game, I also have to use the Unity Network - which means I lose the solver references I assigned to the PlayerPrefab when removing it from the scene (which I have to do since I'm using the NetworkManager). So my question is: is there an easy way to assign the solver references via the VRIK script? I've been looking at the script for a while now and since it's really encapsulated I coundn't figure out a way to do it. I'm pretty sure there's quite an obvious solution I just couldn't see (since those are all more or less public fields) - so it would be wonderful if anyone could help me out :)

    thanks :)
     
  34. mckelynn

    mckelynn

    Joined:
    Dec 20, 2018
    Posts:
    3
    Hey, sorry if this is a noob question.

    For models with 3 or more legs:
    Once you use Final IK to set up the points on all the legs, how do you actually script the leg movement?
    I see no tutorials about how to actually set up the scripts that are provided in the demo (like the CCD IK demo) that control the movement.

    Is there any specific documentation I can refer to that can help? General advice? This is the model I'm trying to FinalIK all four legs of and get to walk on any terrain: https://assetstore.unity.com/packages/3d/characters/animals/iguana-57458

    I used your guide (
    ) to set up the points on all the legs, but the tutorial stopped before introducing scripts. So I just really would like to have guidance on how to script the movement.
     
    Last edited: May 28, 2019
  35. yaffa

    yaffa

    Joined:
    Nov 21, 2016
    Posts:
    34
    Hi,
    I am trying the Final IK with Steam VR and the character has a very weird walk with legs always bent. How do I fix this so that legs appear to be moving in a walk style?
     
  36. yaffa

    yaffa

    Joined:
    Nov 21, 2016
    Posts:
    34
    Hi,
    My characters legs are always bent in a weird position and it does an awkward drag movement when I move the player around. I'm using SteamVR and Rift.
     

    Attached Files:

    • vrIK.png
      vrIK.png
      File size:
      349.4 KB
      Views:
      188
  37. gliealonso

    gliealonso

    Joined:
    Oct 21, 2018
    Posts:
    16
    I am also having another issue with the VRIK, that I cannot change the Wrist To Palm Axis and neither Palm to Thumb Axis, whenever I click another object and come back, the value switch to a default one.
     
  38. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,965
    Hey,
    Its likely something out of sync with the order and frequency of updating the IK, physics and camera, only showing up with lower frame rate. Not sure what exactly without seeing your project, but I have started making an example of how to make VRIK puppets move, jump and teleport smoothly. Here's the demo set up for just Oculus for now.

    Hey,
    The Interaction System was designed to be used just for picking stuff up and pressing buttons, so doing stuff like holstering/unholstering might be pretty near or over it's limitations. The reason is that it can't handle interaction targets being parented to the bones of the model directly. That is because effector target positions can not be updated during the solving process and so they do not follow the motion of their parents. What I mean is, if you parent the holster target to the spine bone, your hand will move there with IK, but if the spine bone moves due to that same IK, the hand target will not be moved along and the hand will end up where the IK target was relative to the spine in the animation.

    So I can not guarantee full accuracy when the targets are parented to the bones of the avatar.
    It is the same problem with doing 2-handed interactions (see the "Interaction Pick Up 2-Handed" demo).

    (2) Should be fine, no problem with performance for having 2 interaction objects.
    (3) You can have as many events as you like, they are being triggered by the "Time" variable of the event. The events can send you all kinds of messages. The "OnPickUp" is a string field, you can change it. Or preferably use the Unity Events below instead.
    (4)
    Code (CSharp):
    1.  public OffsetPose offsetPose;
    2.  
    3. offsetPose.effectorLinks[0].offset = something;
    Hey,
    Aiming a blocking animation would be done the same way as you'd aim a punch. Probably the easiest would be to start with the "Aim Swing" demo, try to do it with just AimIK first.
    About dodging, that sounds more complicated. Could try using FBBIK effector offsets, like in the "Effector Offset" demo. You would predefine a set of offsets for each dodge direction, like copy EffectorOffset.cs and name it DodgeOffset.cs, then play the scene and tweak the offset values until you have a good offset pose for dodging left. Copy the component, exit play mode and paste the values so you don't lose them. Then make another DodgeOffset for dodging right and other directions. Finally, make a script that blends the weight of a DodgeOffset in and out if you wanna trigger a dodge.

    Hey,
    If you go to the "Melee" demo and select the "Prop Melee" object, you'll see it has an "Additional Pin" object parented to it with a Rigidbody and a ConfigurableJoint on it and it's position a little closer to the end of the prop. It is also assigned as "Additional Pin" in the PropMelee component on the Prop. To use an additional pin, you'd have to set up your prop just the same. It would be easiest to just copy the prop from the Melee demo and replace the mesh and the colliders. If you're about to start with props, it would be best if you PM'd me with your invoice number. The entire prop system has been redesigned for the next version and made a lot easier to set up and manage. I'd send you the latest, save you some pain.

    Hey,
    It already works on Quest, just like every other platform supported by Unity. The setup is no different from Rift or Vive so I don't have any demos specific to Quest.

    Hey,
    Didn't quite understand how you were losing the references. Normally in multiplayer you would spawn in a character prefab with VRIK already on it and all references already set. Or add VRIK in Start and call, ik.AutoDetectReferences(); right after if it's a Humanoid.

    Hey,
    There is an example of procedural spiderlike leg movement in the "Mech Spider" demo. The code is in MechSpider.cs, MechSpiderLeg.cs and MechSpiderController.cs.

    Hey,
    If the legs are always bent, it might be just that your avatar is too large for the player. Scaling it down from the root might help. But if you were referring to the weird walking style of the built in procedural locomotion, it was designed in the early days of VR for just shuffling the feet around a few square meters space, it doesn't do walking from A to B wery well, nor roomscale. For that I'd suggest you use a standard 8-direction strafing animation blend tree (like "Grounded Strafe" state in the "Humanoid Third Person" controller included in the package, although using better animations like Kubold's Movement Animset Pro from the Store would give much better results) and make a script that makes that controller follow the horizontal direction towards the HMD.

    Hey,
    That's a new one.. Can you please tell me if your avatar was a prefab and your Unity version?

    Best,
    Pärtel
     
  39. nglasl

    nglasl

    Joined:
    Oct 22, 2018
    Posts:
    3
    Hi there, I'm encountering an issue when using Aim IK where my character's arms completely ignore physics (please see attached). I've tried playing around with all the settings, but I can only think to detect a collision/trigger and set the Aim IK weight back to 0. However, the collision/trigger is never actually detected.

    I should note, the arm colliders/triggers work perfectly when Aim IK isn't active. I guess it makes sense, as in, they're just pointing towards my target (straight ahead). Alternatively, I could do some raycasting, but I feel like that's over complicating things and I'm missing something obvious here? Thanks in advance!
     

    Attached Files:

    • 1.png
      1.png
      File size:
      34.8 KB
      Views:
      188
    Last edited: May 29, 2019
  40. Mikekan13

    Mikekan13

    Joined:
    May 30, 2015
    Posts:
    72
    That sounds quite possible I have moved around the script execution order a lot. https://gyazo.com/66658959db9acba13023582f7a736bb8 I'll take a look at the demo but I only have a vive right now.
     
  41. teighshiclbw

    teighshiclbw

    Joined:
    Jun 26, 2018
    Posts:
    34
    Hi partel

    I encounter a problem when using Rotation Limit Spline
    I want character's spine to rotate left, rotate right, rotate down 25 degrees max, rotate up now allowed.
    So I add Rotation Limit Spline to Bip001 Spine, Bip001 Spine1, Bip001 Spine2.
    Set Bip001 Spine and Bip001 Spine1's up node and down node's Limit to 0.01, for Bip001 Spine2, up node Limit is 0.01, down node Limit is 25.


    The problem is that when TwistLimit not set, aim up looks good


    When TwistLimit set and aim up, upper body lean obviously, this is not acceptable


    But I need TwistLimit, because if I disable it, when character aim right, upper body lean a little bit, which is not acceptable too

    So, TwistLimit enabled, aim up not correct, if TwistLimit not enabled, aim right not correct.

    How to fix this?

    Project:http://www.mediafire.com/file/3m9rk8rz1vgtbbz/IKTest2_Aim_Up_and_Right.rar/file
    Thanks!
     
  42. unity_3drapidsolutions

    unity_3drapidsolutions

    Joined:
    Nov 18, 2017
    Posts:
    20
    Thank you for this additional detail! It raises one additional question for me. For my holstering and unholstering, my current references to the desired hand locations are not within the skeletal structure - instead they are empty gameobjects within the character root. I understand that this is probably why I have been having my preliminary success.

    However, my issue with this strategy was that when holstered, the holster & gun does not move 'realistically' with the underlying animations, since their frame-to-frame offset is only based on root and not based on the specific skeleton bone motions.

    My current plan to resolve this before seeing your reply was to simply put the holster as a child of a skeleton bone with an offset, but your message seems to dissuade me of this. Hence, I tried a recent approach though scripting where I measure the transform of a reference bone and use an offset to keep it in sync. However, it does not seem that this approach is valid either and its unclear if its due to execution order (despite me using LateUpdate). Do you have any tips for this?
     
  43. NikkiC5

    NikkiC5

    Joined:
    Jun 11, 2016
    Posts:
    9
    Hi Partel,

    I recently purchased FinalIK for use in VR with Vive trackers. VRIK seems to be working well. I have one issue. What's the best way to get back to the default state of a character model after nulling the solver targets? I tried backing up the start transform values of the solver targets and assigning these back, but the targets looked way off. Could be I backed up the global values instead of local ones. But is this the way to go? Thanks!

    Nikki
     
  44. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,965
    Hey,
    Could you try disabling "Fix Transforms" on the AimIK please, see if it makes the collisions work?

    Hey,
    Looks like you had the spline limits set up with the wrong axis, also the limit had a weird range of motion shaped like an "8". I switched to RotationLimitAngle, made it's axis alight the spine. Also lowered the spine aim weights as when you aim like that, the chest doesn't fully point towards the target, it is more natural to aim with the arms more. Here's the package.
    You should add another AimIK for the neck and head bone, to make the character look at what it is shooting. Just make sure to solve that last.

    Hey,
    Does it work as you'd like it to if you parent the holster to a skeleton bone? Because if you only need to carry on the animated motion of the bone and the hand IK doesn't move that parent bone at all or not by too much, it should be fine.

    Hey, thanks for the purchase and welcome aboard!
    You could make sure "Fix Transforms" is enabled, then disable the IK component in LateUpdate. Or disable it at some other time and call ik.solver.FixTransforms();

    Normally, if Fix Transforms is enabled, the solver resets the character to it's default pose in each Update, before animation runs. Then the solver updates in LateUpdate, but after your own LateUpdate code, as it has set itself to a very high value in the Script Execution Order. so if you disable the component after FixTransforms is colled and before the component updates for the frame, the character will be in the default pose or the animated pose if you have the Animator running.

    Best,
    Pärtel
     
  45. teighshiclbw

    teighshiclbw

    Joined:
    Jun 26, 2018
    Posts:
    34
    RotationLimitAngle can't seems to limit diffrent direction, for rotating down, I need bone limit to 25 degrees, for rotating up, I need bone limit to 0 degree, that means I don't want bone to rotate up, so I can't use RotationLimitAngle.
    RotationLimitSpline can limit up, down, left, right with diffrent angle, it looks like what I need, but If I using this, I encounter above problem, which I can't seems to solve
     
  46. Silly_Rollo

    Silly_Rollo

    Joined:
    Dec 21, 2012
    Posts:
    485
    I need a runtime version of the mecanim muscle editor where you can open/close hands with a simple slider to affect finger positions. Is that already implemented somehow or in one of the examples? I was gonna write up my own (looking at FingerRig as an example) but before I bothered I wanted to make sure I wasn't redoing something already there.
     
  47. Musonica

    Musonica

    Joined:
    Jul 25, 2017
    Posts:
    5
    Hey :) I'm working on a kind of hybrid adaptive character animation rig with FinalIK that needs to combine / switch between:
    • conventional (non-rootmotion) animations
    • procedural animation (in this case I'm using FinalIK to control say a hand Y axis motion via a variable)
    • adding an object to the rig in various configurations (i.e. a weapon that could be used both 1 or 2 handed, held in multiple different ways, and even attached to different body parts (hand, elbow, hip)
    Ideally I'd like to blend / mask seperate body, hand and facial animations,
    Yet shape / guide / override this output via simple procedural animation parameters and FinalIK.

    Conceptually, I'm currently unsure of the best approach to implement this in a clean and flexible way... and prototyping things with dodgy hacks at the moment. One big issue in my current approach is the "weapon" can be external and related to the character with FinalIK hand position tracking and relative body positioning, or attached to one hand or both or another body part whilst being procedurally controlled and fed sub animations.

    I'd welcome any advice to realise this!
     
  48. nglasl

    nglasl

    Joined:
    Oct 22, 2018
    Posts:
    3
    Aha, that works! I tried playing around with that, but it was causing other issues at the time. Looks like it's all working nicely now, thanks heaps.
     
  49. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,965
    Hey,
    The limits you had on the spine would not work like that. This is how they looked like:
    Invalid limit.JPG

    The Axis was wrong, the axis should be pointing up towards the next bone (-1, 0, 0). Also that 8-shaped range of motion makes no sense. With Axis pointing forward, the twist motion would be leaning left/right, not turning left/right. It might be easier to do a limit like you described with RotationLimitPolygonal, like this:
    Fixed limit.JPG

    Hey,
    No, sorry, don't have anything for that, but it can be done with HumanPoseHandler.GetHumanPose(), adjusting the muscle values in the ref'd HumanPose, then calling SetHumanPose().

    Hey,
    Not sure if I understood fully what you meant, but the way I'd use Final IK to save time with weapon interactions without making everything feel too "procedural" or spending too much CPU resources would be this:

    Have base animations for all different weapon types. So it would be ideal if you general had pick up and holster, shooting and reloading animations for pistols, sub-machine guns and shotguns, basically every weapon type that requires a different kind of handling.
    Then I'd use AimIK to care care of the aiming precision.
    On top of that, you can use a LimbIK on the secondary hand to adjust it's position for each specific weapon mark. I mean if your base animation was made for AK-47 and you wish to use the same animation set for an M4, you'd just need to offset the position of the secondary hand as the support handle is positioned differently. That offset can be applied in the rotation space of the primary hand, so as the gun is parented to it, the offset will always align with the gun.

    Best,
    Pärtel
     
  50. yaffa

    yaffa

    Joined:
    Nov 21, 2016
    Posts:
    34
    Thanks for the help. If I get this right, you mean to say use animations for walking and then shift back to VRIK when idle? Is there a way to just have the hands + Head + chest follow the HMD and have walking animation on the legs so that even when walking if the player looks around, or moves the hands they can see the hand on the controller position?