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. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi, have you set "Is Kinematic" to false on that Rigidbody? InteractionSystem doesn't handle physics stuff automatically, so you'll have to set it non-kinematic yourself when it is supposed to fall.

    Best,
    Pärtel
     
  2. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    200
    Ok i've fixed all that. I have the code working right. However I'm getting this issue now.


    This is what happens when I try to change the offset position. The character skips like that. This is the code.

    Code (CSharp):
    1.     [Tooltip("The object to interact to")]
    2.     [SerializeField] InteractionObject interactionObject;
    3.     [Tooltip("The effectors to interact with")]
    4.     [SerializeField] FullBodyBipedEffector[] effectors;
    5.  
    6.     public InteractionSystem interactionSystem;
    7.     public InteractionObject ball;
    8.  
    9.     public OffsetPose holdPose;
    10.  
    11.     private float holdWeight;
    12.     private FullBodyBipedIK ik;
    13.  
    14.     public bool itemHeld = false;
    15.  
    16.     IEnumerator OnPickUp()
    17.     {
    18.         ik = ball.lastUsedInteractionSystem.GetComponent<FullBodyBipedIK> ();
    19.  
    20.         while(holdWeight <1f)
    21.         { holdWeight += Time.deltaTime;
    22.             yield return null;
    23.         }
    24.     }
    25.  
    26.     // Use this for initialization
    27.     void Start ()
    28.     {
    29.  
    30.     }
    31.  
    32.     void LateUpdate()
    33.     {
    34.         if (ik == null) return;
    35.  
    36.         holdPose.Apply (ik.solver, holdWeight, ik.transform.rotation);
    37.     }
    38.  
    39.     // Update is called once per frame
    40.     void Update ()
    41.     {
    42.         if (Input.GetKeyDown (KeyCode.B) && itemHeld == false)
    43.         {
    44.                         if (effectors.Length == 0)
    45.                 Debug.Log ("Please select the effectors to interact with.");
    46.             foreach (FullBodyBipedEffector e in effectors)
    47.             {itemHeld = true;
    48.                
    49.                 interactionSystem.StartInteraction (e, interactionObject, true);
    50.             }
    51.         }
    52.  
    53.         if (ik == null) return;
    54.  
    55.         if (itemHeld == true) {
    56.             if (Input.GetKeyDown (KeyCode.B))
    57.                 StartCoroutine (Drop ());
    58.         }
    59.     }
    60.  
    61.     IEnumerator Drop()
    62.     {
    63.         GetComponent <Rigidbody> ().isKinematic = false;
    64.         transform.parent = null;
    65.  
    66.  
    67.         while (holdWeight > 0f)
    68.         {        itemHeld = false;
    69.             holdWeight -= Time.deltaTime * 3f;
    70.             yield return null;
    71.         }
    72.     }
    73. }
    74.  

    I used your examples to write that code and it works fine. I'm able to pick up and drop at will with physics. But when I try to change the offset for where she's holding the box, the characters stutters like that.

    Can you please help?

    I'm using opsives Third Person controller to move my character.
     
  3. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Could it be that the recoil script only works properly if aim ik is updated before fbbik? It seems it keeps aiming at the target, even when the recoil happens.

    It seems as soon as I add a right arm effector to fbbik aim ik gets inaccurate, even without the right arm added. So at the moment I have to update aim ik after fbbik, which seem to lead to problems with the recoil script.

    Is there any preferred order when using fbbik, aimik and lookatik? At the moment I update them that way:

    1. fbbik
    2. aimik
    3. lookatik
     
    Last edited: Sep 22, 2016
  4. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi,
    Do you have the Animator on AnimatePhysics?
    If so, offset pose should only be applied on fixed frames, not each LateUpdate. Try to use solver.OnPreUpdate delegate instead of LateUpdate:

    Code (CSharp):
    1. ik.solver.OnPreUpdate += BeforeIK;
    2.  
    3. void BeforeIK() {
    4. // Stuff that was in LateUpdate
    5. }
    Hi,
    The update order should definitely be FBBIK, AimIK, LookAtIK.
    Does it change anything if you unassign AimIK from the Recoil component, just leave it empty?
    If you could send me a package to take a look at that would be the quickest solution.

    Cheers,
    Pärtel
     
  5. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    An example package could take some time, as the whole character is setup from the database and uses UMA. But it's easy to reproduce, just open the recoil example scene and add the ik execution order component as shown here:

    http://imgur.com/a/Ene4X

    Don't forget to disable the fbbik and aimik component.

    The recoil itself is working, but the barrel of the gun keeps locked at the aimik target. That's probably because the hand rotation assign inside AfterFBBIK() is executed after fbbik and gets overwritten by AimIK afterwards.
     
  6. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    200
    Alright. Thank you very much man. Animate Physics was on, so I just used the ik solver preupdate stuff. Thank you.

    One question, what if I wanted to pick up an item then place it back in the original position I picked it up from. Can Final IK help me with that?
     
    Last edited: Sep 22, 2016
  7. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    OK I understand now, thanks!

    Its not the AfterFBBIK stuff, but simply the fact that if AimIK solves last, it will normally just keep the gun aimed at the target at all times.

    Please import this patch, it will give you "Aim IK Solved Last" option in Recoil, which you should enable.

    Hey, have you tried using the Interaction System? See the "Interaction System" demo scene.

    Best,
    Pärtel
     
    silentneedle likes this.
  8. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Works, thanks Pärtel. :)
     
  9. davidhughes3d

    davidhughes3d

    Joined:
    Nov 30, 2012
    Posts:
    29
    Hi Partel,

    I am excited to see VRIK release eventually. I was just wondering tonight; In my game (a VIVE VR game), I am eventually going to have to take player height calibration into consideration. If I plan to use IK setups from Final IK or VRIK, and I eventually find a way to adjust the players "body" size according to their height. Will all the mechanics of the IK rig still translate properly over to the character after the body is adjusted in scale via whatever is parsed from the height calibration script? Should it work still in theory? Is this something that has been considered in the development of VRIK, or maybe it is outside of the products scope? Not sure.
     
  10. reocwolf

    reocwolf

    Joined:
    Aug 1, 2013
    Posts:
    182
    Hi I have some questions and I'm sorry if they have been asked before.

    1. Say I want to have my character attach to a rope. For example if he is falling but the rope is withing range (I've just seen a couple of videos about the interaction system) and I activate the interaction he attaches himself to the rope, it swings and the character can detach himself by activating the interaction again. All procedural without animation. I guess this is possible but what would be a good approach? Also, don't know if this follow up question applies to FI but how would I make the rope swing to a certain direction according to physics and the direction the player presses? (just looking for recommendations on how to do this.

    2. Procedural climbing - how would I make a character procedural climb walls a la Assassin's Creed or Tomb Raider without/ or with limited animations. Say, I have bricks that are targets and the player wants to go in a certain direction. How would I do this? Something like setting a motion/animation with the char controller to move the arm and then let FI Interaction sys do the rest and interact with the brick and attach to each one as it goes? Any recommendations of best approach?

    Just trying to see how procedural I can get with the help of Final IK.

    Thanks,
     
  11. Doperomeo

    Doperomeo

    Joined:
    Dec 25, 2013
    Posts:
    1
    Hi how do i enable/disable a Final IK component? Example Aim IK. How do i temperorarily disable it and enable it from another script of my own?
     
  12. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi,
    No problem there, you can adjust the proportions of the character in each frame if you need to, does not matter for IK and there is no extra performance cost to it.

    Hi,

    1. If using the Interaction System, then make a single interaction (InteractionObject) that moves the hand to the rope and back. Then add an event to the InteractionObject that pauses the interaction when the position weight has reached 1 (hand is on the rope). Then you can just use InteractionSystem.ResumeAll(); to let go of the rope. Also add a message to the event that calls a function in a script that parents the character to the rope or something to make it follow its movement.
    You can make the rope swing to a certain direction if you just add force to its rigidbodies in the desired direction.

    2. Stuff like we have seen in AC is extremely complex and has been accomplished over years of work and iteration. There are many solutions for climbing and most of all it depends on the environment, how standardized it is. If it is just made out of bricks, its relatively easy, but if its fully organic and markerless, it will be very difficult. That's why I have not made a generic climbing solution yet, there are just so many things that depend on the specifics of the game. You could go for a fully animation based climbing with standardized ledge heights, then start adding IK to give you more flexibility. If you know the offset of the real legde from where it is supposed to be in the animation, you can just add that offset to the hand effectors when using FBBIK.

    Hi, just enable/disable the IK component like any other component in Unity.

    Cheers,
    Pärtel
     
  13. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Hi, I'm using the Grounding solver, and getting some flickering of movement in the legs, like there's some small precision issue. Is there any way to prevent this?
     
  14. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    I've also observed this, especially when foot ik is enabled in the animation state.
     
  15. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    It may be something like not setting as solved due to precision, when "close enough" would do.
     
  16. probitaille

    probitaille

    Joined:
    May 5, 2015
    Posts:
    34
    Does the VRIK will be ready as planned in the next weeks? I can't wait your product! :)

    Hey! I'm planning to do the same thing. I wonder if I can change the height of the body and the arms length in a calibration process (like asking the user to do a T-Pose). It can be an interesting feature for VRIK because you have a lot of chance to have problems (avatar that tilts his body) if your head (currently using head effector) is not at the same height of your avatar by default.
     
  17. davidhughes3d

    davidhughes3d

    Joined:
    Nov 30, 2012
    Posts:
    29
    Honestly, @probitaille, I have no idea where to start with this concept of adjusting the character scale via height calibration. I am probably going to opt out of using IK for the VR game because unless it is magically implemented into VRIK somehow, I don't code and would expect that kind of setup is pretty complicated. If you come across an example of something similar to what you or I are talking about that is a pre-canned solution please let me know. Would probably be a good asset to build an sell on the store, though. Someone should get on it, lol.
     
  18. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey, could you send me a screenshot of the Grounder component and a video of the flickering if possible?

    Its not in VRIK, but I have given it some thought. Different proportions are a really a big issue and the quality of IK depends heavily on how close the avatar is to the player proportionally. The only solution I see now is to make a calibration process, where you stand in a couple of poses like T and I pose, that should give enough information. The length of the arms and shoulder width are the most important things there and using those 2 poses they can be approximated quite well I suppose. The height of the player mostly matters when you have to pick up something from the ground. If you are shorter than the avatar than you just won't be able to. But you can have your player just enter his/her height somewhere and hope they don't lie lol. Then there are also issues with wider people not being able to grab guns from holsters on the hips of a skinny avatar and it would be great to consider people in wheelchairs and what not... Its all largely unexplored territory. The scaling of the avatar is easy to some extent, we can just adjust the localPositions of some bones. You could also have different avatars for the player to choose from, but the problem is watching people play Dead & Buried I have noticed a lot of them want to be different in VR, so many guys choose female avatars and so on... makes our work even harder.

    Cheers,
    Pärtel
     
    davidhughes3d likes this.
  19. JonDadley

    JonDadley

    Joined:
    Sep 2, 2013
    Posts:
    139
    Hi Partel,

    VRIK sounds very interesting. I'm working on a Vive multiplayer game where other players have IK avatars (although the local player does not have one). One of the problems I have at the moment is that if a client player physically walks around, the IK'd avatar does not walk to their new position - the arms and head IK to their position but their feet stay on the spot and the avatar 'leans' over.

    Will VRIK address avatar locomotion at all? If not, what would you suggest for getting around this issue?
     
  20. davidhughes3d

    davidhughes3d

    Joined:
    Nov 30, 2012
    Posts:
    29
    Exactly my thoughts. There is a load of considerations to make. I suppose the quickest solution would be to offer various Avatar heights, out of the box. We won't be able to please everyone, but that is typical in this realm.
     
  21. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi,
    Currently VRIK has built in procedural locomotion for side-stepping and turning. No walking from A to B yet, but I guess for that locomotion could be disabled and switched to animator controller.
     
    JonDadley likes this.
  22. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Nice leaning logic, when will it be out? Or can we be a beta tester for you? :D Our game needs this :D

    Our own leaning logic with Final IK is really wonky, can be seen here :D Look at the soldier model when he is running away

    youtu.be/BN8_ZlzElXg?t=31
     
  23. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    I'm releasing it after Oculus Connect 3, so not too much to wait anymore.
    Cheers,
    Pärtel
     
    AndersMalmgren likes this.
  24. IQ_Null

    IQ_Null

    Joined:
    Aug 9, 2016
    Posts:
    2
    Hi! For quite a long time I am trying to do a full body tracking. I use HTC Vive, LeapMotion and additional trackers for legs. With hands and feet are no problems, but to adjust the head does not work. I use a script FBBIK_Head_Effector, but do not work. Maybe there is a ready solution for virtual reality? We will be in the same stage a few people, so it is necessary that all the movements are realistic. In May, you wrote that the work on support for virtual reality, may be there are some solutions? Thank you.
     
  25. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi,
    How exactly is the head not working?
    VRIK is ready, it will be added to Final-IK after Oculus Connect3, which is already next week.

    Cheers,
    Pärtel
     
    LostPanda and WildStyle69 like this.
  26. IQ_Null

    IQ_Null

    Joined:
    Aug 9, 2016
    Posts:
    2
    Thanks for the quick response. When I tune Head effector, the head does not affect the rest of the body, just hanging in the air on a long neck. Projects in the folder "Virtual Reality," designed for Oculus Rift and do not work with HTC Vive.
    We have the first demonstration project investors on Wednesday. I want to make it look beautiful. Can I get VRIK a little earlier?
     
  27. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey, sent you a PM.
     
  28. jokwod

    jokwod

    Joined:
    Oct 3, 2016
    Posts:
    1
    Hey Partel

    are you planning on a sale alongside the release of VRIK? will be picking up regardless, but just checking if it is worth getting now or waiting a week or so.
     
  29. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Today I completely removed version 1.3 from the Plugins folder and I updated to the latest 1.4 version, but I am getting the following compile errors:

    Assets/Plugins/RootMotion/FinalIK/Grounder/GrounderBipedIK.cs(31,24): error CS0246: The type or namespace name `BipedIK' could not be found. Are you missing a using directive or an assembly reference?

    Assets/Plugins/RootMotion/FinalIK/_DEMOS/Biped IK/Scripts/BipedIKvsAnimatorIK.cs(13,24): error CS0246: The type or namespace name `BipedIK' could not be found. Are you missing a using directive or an assembly reference?

    [EDIT]
    I forgot to delete the Plugins\Editor\RootMotion folder first. I deleted that and re-imported and now it appears to be fine.
     
    Last edited: Oct 5, 2016
    Partel-Lang likes this.
  30. LostPanda

    LostPanda

    Joined:
    Apr 5, 2013
    Posts:
    173
    THIS GOOD NEWS!!!
     
  31. probitaille

    probitaille

    Joined:
    May 5, 2015
    Posts:
    34
    Is VRIK will be a complete new plugin for Unity or as an update of the current FinakIK?
     
  32. s_guy

    s_guy

    Joined:
    Feb 27, 2013
    Posts:
    102
    Hi Pärtel,

    I have a character using FBBIK, Grounder, and AimIK with your recommended solution for left hand placement. It took some tuning and some changes to my custom character controller to get everything nice (as expected), but I'm very happy with the results!

    One issue is that when it aims very high (near vertical), the feet get pulled up from the ground. My objective is to keep the feet planted via the grounder and let it have authority over the pelvis / hip / root. The AimIK only has the mid and upper spine and not the hips in its chain. I know it's impossible to know my full setup without a ton of details, but do you have any tips for solving this?

    EDIT: I found a workaround by conditionally setting a negative Lift Pelvis Weight in the Grounder when aiming high.
     
    Last edited: Oct 9, 2016
  33. rob_vld

    rob_vld

    Joined:
    Jul 9, 2013
    Posts:
    191
    *VRIK*VRIK*VRIK*VRIK*VRIK*

    *pokes @Partel-Lang*

    *VRIK*VRIK*VRIK*VRIK*VRIK*
     
  34. pdq72

    pdq72

    Joined:
    Sep 29, 2013
    Posts:
    43
    Hello Partel,

    I just want to say thank you for a wonderful system. I have both FinalIK and PuppetMaster.

    I have question about PuppetMaster: I have set my mecanim character into a pose via animator update in the editor (I am using a script to update while in edit mode). The question is, what methods do I need to update puppet master to match the new pose? Once again this is while in edit mode before run-time. Without updating puppet master in edit mode, the ragdoll stays in its T-Pose while the skinned mesh is in a different pose.

    Thanks.
     
  35. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi guys, sorry for the long wait, I've been extremely busy with Oculus Connect, traveling and all that stuff, but I'm back in office now.

    FIK 1.5 with VRIK has been submitted, is pending review! :)
    I just really hope it lives up to all the expectations...

    Hi! Sales are not up to me really, it is fully up to the AS team to select packages for sales, but FIK is on the list so a sale is coming sooner or later.

    Hi!
    If its AimIK pulling the legs up, remove the pelvis bone from its Bones.

    Cheers,
    Pärtel
     
    LostPanda likes this.
  36. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi!
    Unity physics doesn't work in editor mode (as far as I know) so neither does PM.

    Cheers,
    Pärtel
     
  37. s_guy

    s_guy

    Joined:
    Feb 27, 2013
    Posts:
    102
    @Partel-Lang

    The pelvis isn't in my AimIK Bones list, though the torso is. I tried unweighting and even removing the torso bone from the list, but AimIK still pulls the legs up (by the pelvis) when he aims high. I might be able to get away with my workaround (which is to circumstantially adjust the Grounder's Lift Pelvis Weight to a negative value), but it looks like the special cases are getting out of hand and it would be nice for a general system solution. Would be grateful for any other leads. Thanks.
     
  38. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    If AimIK has no bones that are parents to the legs, then it can't pull the legs anywhere, it must be something else. Try disabling IK components/scripts to see what is resposible for it.

    Best,
    Pärtel
     
  39. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    FIK 1.5 is ready for download! :D

    Also, check out this video of our panel talk about Dead and Buried at Oculus Connect 3:
     
    khos, JonDadley and Ostwind like this.
  40. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Is it me or is the aim ik solved last toggle in the Recoil.cs missing in the last update?
     
  41. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Damn, I must have developed it in another project and forgot to put it in the main one, sorry.
    Can you reimport the patch?
     
  42. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    I've re-downloaded the asset, but it doesn't contain any updated recoil.cs.
     
  43. JonDadley

    JonDadley

    Joined:
    Sep 2, 2013
    Posts:
    139
    I've been talking to some devs who have used VRIK today and they've shown me some videos of it in their projects and it looks AMAZING. It works really well with walking around in the Vive. Can't wait to try it tonight on my own project. Thank you for your hard work Partel! I'm very happy with my purchase :)
     
    Partel-Lang likes this.
  44. s_guy

    s_guy

    Joined:
    Feb 27, 2013
    Posts:
    102
    Turned out that it was the SecondHandOnGun behavior (example you posted way earlier in this thread) that is pulling the pelvis and legs up when the AimIK aims high. I zeroed out the left arm pull in the FBBIK and it now mostly does not pull the legs (without the Grounder pelvis weight compensation I described previously).
     
  45. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Please reimport this patch.

    Hey, thanks, I'm super glad, was afraid of the very high expectations :)
     
  46. JonDadley

    JonDadley

    Joined:
    Sep 2, 2013
    Posts:
    139
    No need to worry, everyone I spoke to has been very impressed with it. I added it to my project last night and was amazed how quickly it was setup (the automatic bone detection for Fuse was excellent!) and how well it worked!

    Here's some quick videos I made of my experiments last night

     
  47. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Heh, thanks for sharing the videos, looks groovy! :D
    Go through some of the parameters in there, each character has a different bone structure so there's a lot to gain from just tweaking stuff.

    Cheers,
    Pärtel
     
  48. Fairennuff

    Fairennuff

    Joined:
    Aug 19, 2016
    Posts:
    88
    Hello Partel.

    Thanks for the awesome update! My Vive game is really coming along now thanks to the VRIK add in. My model follows very well but when i twist my wrists the forearm doesnt appear to move. I've checked the bone and it definitely effects the model. If I put my palm up the junction between the forearm and hand gets real choppy because the forearm never twists. Is there something I can do to fix this?

    Thanks!
     
  49. s_guy

    s_guy

    Joined:
    Feb 27, 2013
    Posts:
    102
    Thanks for the help @Partel-Lang

    The Recoil behavior is awesome and super flexible. I'm going to stop using hand animations for this. Just so many great toys to discover in this package.

    Can you please share some tips for making the SecondHandOnGun behavior work with the Recoil behavior? I have each working independently, but if I enable both at the same time, the recoil offset isn't realized.

    My Final IK behaviors on this character are in this order:
    • FBBIK
    • Grounder FBBIK
    • AimIK
    • SecondHandOnGun (not in package, but you provided way earlier in this thread)
    • Recoil
     
  50. bulisor

    bulisor

    Joined:
    Feb 12, 2016
    Posts:
    7
    Hi sir. I have a little problem with FullBodyBipedIK. I don't find how to reset poser local rotation weight and local position weight, only poser weight, and I need to reset local rotation too. Can i do it from solver, without parse entire skeleton to find hand poser script? Thank you.