Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    The link isn't working, no URL :)
     
  2. KrayonZA

    KrayonZA

    Joined:
    Mar 5, 2013
    Posts:
    52
    Hi

    Thanks for the patch it works a quite well.

    The last link you posted isn't working would also like to try that :)
     
  3. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Damn.. sorry, fixed the link.
     
  4. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    Thanks for the update Partel, that's fixing the issues I was having. Excellent job!
     
  5. Madasebrof

    Madasebrof

    Joined:
    Feb 1, 2014
    Posts:
    3
    Rock on thanks!
     
  6. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Great! :)

    I've submitted an update to Final IK, it contains all the patches so far. I also had to restructure a big part of FBBIK and FABRIKRoot so they could be upgraded to the current Unity beta versions. It requires for you to reinitiate your existing FBBIK components. You can do it by just right-clicking on the component and selecting Reinitiate from the context menu. The Pull and Reach values of the FBBIK chains will be reset to their default values.

    I hope the update gets reviewed before the weekend..

    Cheers, :)
    Pärtel
     
  7. EarthLaunch

    EarthLaunch

    Joined:
    Mar 7, 2012
    Posts:
    62
    This is amazing, looking forward to the update getting released!
     
  8. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Released..
     
  9. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Pärtel, Thanks for the huge support you´re providing to UMA users =) What you´re doing here is amazing!
    The only thing I was missing was full elbow rotation, but looks like it´s now available =D
     
  10. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Thanks guys, I'll keep trying my best :)

    On a related note, I will be speaking at the Nordic Game 2014 Fast Track about
    "The Challenge - Finding the Limits of Procedural Animation."
    So hopefully I can meet some of you guys there :)

    Cheers,
    Pärtel
     
  11. KrayonZA

    KrayonZA

    Joined:
    Mar 5, 2013
    Posts:
    52
    Thanks for all your help with UMA all the patches you released are working 100% :)

    Regards.
     
  12. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi again guys, :)

    I'ts time to showcase what the long advertised Grounding system is capable of.

    Basically in the scene there is a modified version of the 3rd person controller of the new Example Assets with FBBIK Ethan having a GrounderFBBIK component on.

    Hold down left mouse button or left ctrl to inspect this in slow motion.

    Here's how the component looks like:
    $Screen Shot 2014-03-17 at 12.45.42 PM.png

    And thats all there is to it. No motion analysis, no Mecanim curves, just drop on the component and adjust a few params if necessary. ;)

    It has a few things I still want to improve/change so no ETA yet, sorry.

    There is also GrounderIK that can be used with other types of IK solvers, so you can have a spider with 8 legs working with it.
    It doesn't yet support quadrupeds, I mean atm it needs for all the legs to have a common hub (the pelvis), but I definitely want to come up with a way to do this with multiple hubs in the future.

    Cheers,
    Pärtel
     
  13. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    looks really smooth pärtel!
     
  14. KrayonZA

    KrayonZA

    Joined:
    Mar 5, 2013
    Posts:
    52
    Wow awesome cant wait to try this out.

     
  15. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    This is fantastic!

    I have used the Locomotion System a few years ago. The main weakness of it is that it doesn't support moving platforms. Does your solution work with moving/rotating grounds?
     
  16. EarthLaunch

    EarthLaunch

    Joined:
    Mar 7, 2012
    Posts:
    62
    Really excited about Grounding. I see it working with what looks like a Unity Terrain! I plan to use it with Terrains and UMA.
     
  17. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi!

    Yes, I updated the demo and now it has a rotating platform and a hanging bridge with physics. :)
    You can see that it also smoothly traverses small gaps in the bridge.

    Yup, it's Unity Terrain. :)

    Cheers,
    Pärtel
     
  18. KrayonZA

    KrayonZA

    Joined:
    Mar 5, 2013
    Posts:
    52
    Hi Partel

    Me again.. :p

    I'm having an odd issue with the AimIK and i'm hoping you can help because i have no clue where to begin fixing this.

    I put together a simple weapon system then added the IK components like in your 3rdPersonDummy demo which is all working great.

    On the weapon model I added a firepoint transform at the tip on the gun muzzle as a child of the weapon model then when the player presses fire it instantiates the bullet prefab at the firepoint transform and firepoint rotation which is all lined up correctly with the IK.

    Code (csharp):
    1.  
    2. Quaternion oldRotation = firePoint.rotation;
    3. firePoint.rotation = Quaternion.Euler (Random.insideUnitSphere * errorAngle) * transform.rotation;
    4. Instantiate (bullet, firePoint.position, firePoint.rotation);
    5. firePoint.rotation = oldRotation;
    6.  
    The strange issue i'm having is the bullet is being instantiated from the firepoint rotation and firepoint transform of the mecanim animation and not from the IK rotation of the weapon model its like ignoring the IK.

    This is evident when turning the IK on and off while firing the bullet its always instantiated at where the animation is pointing the weapon and not where the IK is pointing the weapon.

    I can post some screenshots later today if that helps to explain it.

    I hope you can help.
     
  19. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Awesome! Does this also work for platforms that are moving? And rotate around the y axis?
     
  20. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    It doesn't follow the same logic as the Locomotion System, you see
    Grounding only changes the vertical position and the rotation of the feet. So whether your character stays on moving platforms or rotates along with a platform it completely up to your character controller.
     
    Last edited: Mar 18, 2014
  21. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    It must be just the timing, I think you are firing your weapon before the IK solves for that frame. Take a look at Edit/Project Settings/Script Execution Order and add your script that is firing the bullet to a value that is higher than all the IK components. And make sure you are firing in LateUpdate.

    Cheers, ;)
    Pärtel
     
  22. KrayonZA

    KrayonZA

    Joined:
    Mar 5, 2013
    Posts:
    52

    Hi Partel

    That fixed it, The ScriptExecution Order, I feel like a dumbass that didn't even cross my mind.

    Thanks appreciate your help :)
     
  23. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Yes, of course. That makes sense. I could easily achieve that effect by using IK for the feet to "glue" them to certain positions.
     
  24. Alf203

    Alf203

    Joined:
    Dec 7, 2012
    Posts:
    461
    Simply Amazing !
     
  25. venain

    venain

    Joined:
    Aug 10, 2013
    Posts:
    6
    This looks great Partel! I've been following this asset for a while as the project I'm working on could greatly utilize it, I'm just waiting for the grounder system before I purchase. Great job!
     
  26. Alphalpha

    Alphalpha

    Joined:
    Oct 9, 2013
    Posts:
    74
    Hello Partel, I bought this asset a few days ago and have been playing around with it. It is extremely impressive, and looking at the release version, you're still only at 0.22! Knowing that, I was wondering, what are your future plans for FinalIK? I know you have yet to fully integrate some features like the Grounding system and Animator (both look awesome btw), but are there still many more features you plan to implement, or will you soon switch over to polishing existing features, making them more robust and easy to use? It's difficult to imagine FinalIK having four times as many components, but your wizardly seems to possess few limits.

    In the vein of ease of use, I was thinking about how to speed up implementation of the Interaction System, specifically with picking up/holding objects, and came up with the idea of a 'Hand Poser.' Basically, the script would be placed on a hand, where it would rig up the fingers and thumb with Joint Limits and some form of IK (I was fiddling with Limb, but CCD or FABRIK seems better). To generate a pose for holding an object, you would place the hand in a starting pose (could provide an array of presets), position the object where you want it relative to the palm, set a 'target point' for the fingers inside the object (or simply use its transform). The script would then raycast from the fingertips to the target, generating an IK target for each finger. Once satisfied, the pose could be saved for use with the Interaction system.

    What do you think? Would it be feasible for me to code this? Is it overly complex?
     
  27. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi Alphalpha, big thanks for the purchase and the kind words and welcome aboard! :)

    About the future plans, it has been quite lonely on my support mailbox (especially after 0.22 ;)), so I guess I can concentrate on developing more features (which actually is a very good method for improving the existing ones as they get battle-tested thoroughly in the process).
    Here are some of the ideas that I have more or less solid plans for:

    1. Grounding
    2. Effector Animator
    3. 2D solvers, perhaps also 2D FBBIK
    4. FullBodyGenericIK - using essentially the same solver as FBBIK, but for all kinds of fantasy creatures
    5. More 3rd party support, meaning more Playmaker actions and stuff like that
    6. Particle IK, if I can think of a good enough reason for it. Could be nice for making hair, ropes, cloth-like simulations, but there are solutions for those kinds of things already available

    And of course improved documentation.

    Besides that, there is an infinity of add-on systems I can think of, stuff like procedural climbing, mechanized character systems, generic driving rigs with physics, environmental cognition and response, procedural locomotion and so forth, so forth. ;) They are just ideas at the moment though.

    About the "Hand Poser" idea, I'm not sure if an IK-raycasting solution like that would make it any easier to pose the hand. I mean you'd have to set up the IK for the hand, probably assign all the fingers, tweak the IK settings, rotation limits, set up the object and a mesh/compount collider for it and hope that the raycasting and IK works as expected. That sounds like a lot of work, while you can, as it is, just pose the hand to the object by rotating the fingers, and use it as the target of HandPoser.cs.
    Then of course there is the performance cost of having 10 4-segmented constrained CCD/FABRIK solvers just for the fingers, which is probably something people won't be willing to sacrifice anyway.

    Thanks again for the feedback! :)
    Pärtel
     
  28. Alphalpha

    Alphalpha

    Joined:
    Oct 9, 2013
    Posts:
    74
    Well, it's not like I had much of a choice; there's only so much concentrated awesome I can endure before I yield.

    Those additions all sound awesome; especially the Effector Animator, which looks extremely empowering.

    Those hypothetical additions also sound awesome. About the environmental cognition and response, I was talking with someone a while ago about Euphoria, and apparantly they way the characters respond to 'threats' is by having a 'weight' for each limb and attempting to move high-weight limbs (head) out of the way while interposing low-weight limbs (hands) between themselves and the 'threat.' It seems like this would be fairly simple with a trajectory prediction script, FBBIK, and a script to move effectors outside of the collider of the 'threat.' I was actually considering attempting something like this myself.

    I meant for the Hand Poser to be a workflow tool, something to be used in the editor to generate hand poses for objects so that in-game finger IK would be unnecessary. Posing isn't incredibly difficult, true, but if you were making a game with hundreds of objects of various shapes and sizes you could pick up a tool to quickly generate fairly accurate poses seems like it would be useful. Think Skyrim where your avatar picks up all those objects with his hands rather than his innate telekinetic abilities. Anyway, I may give a whack at it. If I do I'll let you know how it goes.

    Thank you for all the work!
     
  29. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Yes, the hand posing part of Final IK is still quite underdeveloped, I want to give it a bit more attention some time in the future, there are definitely ways to improve and simplify the workflow. :)

    But in the meanwhilte, I have updated the Grounding demo with a lot more dynamic stuff and physics in the scene. There are now moving platforms, dominos, rigid spheres and cubes, extreme slopes, rough terrain and an "ice cube" plate that you can skate around with ;)

    Pärtel
     
  30. Quickfingers

    Quickfingers

    Joined:
    Aug 29, 2009
    Posts:
    268
    The grounding demo looks excellent! Really good job, is there an ETA for this making it into the asset? Looks pretty much done to me :)
     
  31. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    ...it's never done until Partel says it's done...even when it's clearly done.

    :D

    -Steven
     
  32. popawheelie

    popawheelie

    Joined:
    May 27, 2013
    Posts:
    23
    Any idea on ETA would be good, this addition is a bit of a game changer.. so to speak.
     
  33. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hold on, I try to submit it this week :)

    Cheers,
    Pärtel
     
  34. unity_sg

    unity_sg

    Joined:
    Sep 14, 2010
    Posts:
    95
    Hi, is it any way to use the Limb IK script with the rotations limits ?
    I can find a checkbox "use rotation limites" in FABRIK script per example but not in the LimbIK one.
    COuld someone help me please ?
     
  35. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi!

    LimbIK is a basic analytic solver that can't be used with the rotation limits like CCD, Aim and FABRIK. What kind of stuff are you trying to do? perhaps I can suggest you an alternative solution..

    Cheers,
    Pärtel
     
  36. [RV]CWolf

    [RV]CWolf

    Joined:
    Jan 24, 2013
    Posts:
    33
    Hello,

    I recently bought this asset and I'm liking what I see so far. Ideally, I'd like to see more documentation but hopefully that's coming.

    I am having a similar problem as with what Madasebrof explained previously (quoted below), however, I'm using a relatively simple example of LookAtIK instead of FBBIK. The model shakes when using the 'Disable' on start then 'lookIK.Update' in the LateUpdate approach is taken.

    Here is my script (it is a non-monobehaviour as it's being called from another mono-behaviour script from that script's LateUpdate).

    Pastebin Code - http://pastebin.com/NbuqQHCN

    I've checked the Script Execution order, it looks correct.

    The script is being executed after the Mecanim script and I've made sure it's being called from LateUpdate (so after Mecanim). It looks like something is fighting for control though.

    Here is a YouTube video to show what happens. It first shows the problem in Game then Scene View. Then it shows me commenting out the 'Disable / Update' code and setting the LookAtIK to always enabled. This seems to fix the problem but ideally I want the flexibility to update manually like a lot of your examples show.

    Youtube Video - http://youtu.be/GQutryUc_fk

    Would you have any ideas on why this is happening?

    Thanks for your help in advance.
    - Rich

     
    Last edited: Mar 25, 2014
  37. unity_sg

    unity_sg

    Joined:
    Sep 14, 2010
    Posts:
    95
    Hi, thanks for the quick reply.
    I try to do some mecanic arm like in the "FABRIK" demo.
    But when I rotate the arm (I've deleted the rotation limit hinge on the gameObject "HingeXToHingeZ"), the target didn't rotate with the arm.
    Ideally, I need to do exactly the same thing that in this demo but with a separate gameObject as target so I can put in anywhere in the hierarchie.
    (actually the target is a fictive gameObject that appears only when I have selected the FABRIK script)
     
  38. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi, [RV]CWolf, and I appreciate the purchase! :)

    This twitching looks a lot like you have animatePhysics true in the Animator (which makes it update the animation in FixedUpdate), so in this case you should also update your solvers not each frame, but only after FixedUpdate has been called, otherwise, in every LateUpdate, you would be solving IK more often than the animation updates, depending on your frame rate.

    The IK components automatically recognize animatePhysics and the solver manager updates accordingly, thats why it works when you are not using the manual Disable/Update method.

    You can take a quick look at the (very small) SolverManager.cs to see how the automatic updating is handled for animatePhsyics.

    I really wish Unity would give us something like "MonoBehaviour.OnAnimated" so we could get a call from Animation/Animator each time it has finished applying animation on a game object, instead of having to guess when it is done. You can place a hopeless vote for it on here. :)

    Also bare in mind that there is a bug with Mecanim in the current version of Unity with switching animatePhysics on/off in play mode, it resets the playing Animation State, but really does nothing.

    Regards!
    Pärtel
     
  39. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi again,
    you only need a piece of code like that:
    Code (csharp):
    1.  
    2. public FABRIK fabrik;
    3.  
    4. void LateUpdate() {
    5.    fabrik.solver.IKPosition = transform.position;
    6. }
    7.  
    Attach this script to any game object and that will become the target for the solver.

    If that's what you meant..

    Cheers
    Pärtel
     
  40. unity_sg

    unity_sg

    Joined:
    Sep 14, 2010
    Posts:
    95
    Thanks, but that's not what I need.
    What I need to do :
    1. Rotate the mecanic arm and the target should keep his local position (the position of each part of the arm should not change when I rotation or move the arm)
    2. Move the target independently than the mecanic arm
    3. Use rotations limits

    So I think that FABRIK is not the good solution.
    I've tried with the limbIK and then point 1. and 2. works fine.
    But I need to use the rotation limit. Any idea ?
     
  41. [RV]CWolf

    [RV]CWolf

    Joined:
    Jan 24, 2013
    Posts:
    33
    Hi Pärtel,

    Your explanation and suggested fix were excellent. It solved my problem. I'm not sure if I'll need animate physics in the long run but at least I know more information surrounding the issue. I added 4 of my votes to this issue (not that it'll help much but we'll see).

    Thanks again.
    - Rich
     
  42. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Ah, OK.. don't worry, just do the following:

    1. Create an empty gameobject, name it something meaningful, like "Root"
    2. parent the IK chain to that game object
    3. create another gameobject that will be the target for the IK solver, attach a script that sets ik.solver.IKPosition to that gameobject's position
    4. parent that target gameobject also to the Root
    5. play the scene, if you translate the Root, the chain will translate along nicely. If you move the target, the chain will also respond.

    FABRIK is a good solution, but if you want to use rotation limits, consider CCD instead, it is a lot faster and a bit more stabile when constrained.

    @[RV]CWolf, glad it worked out and thanks for the votes! ;)

    Cheers,
    Pärtel
     
  43. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey, I got another demo for you guys...

    woof! ;)
     
  44. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Fantastic Partel!

    I half expected to seeing the dog's head IK 'level' while on an incline so he was still looking ahead, but otherwise very very cool.

    -Steven
     
    Last edited: Mar 27, 2014
  45. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Done, refresh.

    You can try pushing one of them smaller balls around with the forelegs, it's quite fun :)
     
  46. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Yea that feels MUCH better!

    Yay!!...okaynowreleaseitplease!! :D
     
  47. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Really nice Pärtel, I can't agree more with SteveB ;-)
     
  48. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    NO! Agree more please! :D
     
  49. KrayonZA

    KrayonZA

    Joined:
    Mar 5, 2013
    Posts:
    52
    Wow that is really impressive they way he uses he forelegs just adds to the realism.

    Great job Partel.
     
  50. LeftyTwoGuns

    LeftyTwoGuns

    Joined:
    Jan 3, 2013
    Posts:
    260
    I have a question in regards to the interaction system:

    Say you'd like the player controlled character to grab a baseball bat game object from the scene and then be able to swing it. The swinging is handled through animation but the reaching for, grabbing, and holding the bat in the right position is handled by Final IK? Do I have that right? And I assume it parents the game object to a specific bone of the character rig (hand bone in this case) or is some other method used?