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

    andrew210

    Joined:
    Apr 23, 2014
    Posts:
    153


    Hello! Following the tutorial on how to get Final IK to move joins in the right direction, I've pre-rotated the joints in the prefab so that they end up in the right direction. However I can't seem to "undo" the rotation in play mode, it wants to try and move it into the bendy state rather than the neutral state from the idle animation.



    In the "natural" state (before I've tweaked the bone positions), it will bend in all sorts of awkward ways.

    With no Quadraped Grounder and no FullBodyIK component, the neutral idle animation looks like:



    Is there any way I can set the direction of movement for the joints without having it alter the idle states of the animation? Thank you!




    Edit:

    Have removed full body biped IK from the object as it's obviously not a biped. The grounder is still on the object but still no luck with making it work properly unless I "pre-bend" the legs in the right direction. I've tried the legs with CCD IK for the legs with rotation limits but the legs just remain straight.
     
    Last edited: Aug 15, 2019
  2. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,938
    Hey,
    It must be that CCD is updating before you move the hand to stretch it. Make sure your Animator is not in Animate Physics mode, that would cause your LateUpdate code to be out of sync with the IK. Also make sure your LateUpdate script is not at a higher value than CCDIK in the Script Execution Order. If you are updating the IK manually, you'll need to change it so that LimbIK solves first, then your stretching script and then finger CCD.

    Btw, if you switched LimbIK for ArmIK, that has automatic stretching built in and can also use the shoulder for some extra reaching range. Go to the "VRIK (Basic)" demo and copy the "Stretch Curve" over from the Pilot's arm settings to your ArmIK solver to get a good optimal value for the stretching.

    Hey,
    The Final IK Bridge was not written by me so I'm not exactly sure what it does. Could you check the Profiler please and see what kills it, send me some screenshots if you are not sure. 60 to 5 fps hog should show up there nicely.
    Does it help if you switched Grounder quality to "Fastest"? I don't think that's it though, the difference between the quality settings are just a couple of sphere casts vs a raycast per frame.

    Hey,
    You sure there is animation playing on those legs? That should overwrite the bending and straighten the legs.
    If that's not it, could you please send me that horse and the animation you were using so I could take a look myself? Haven't done much horse testing to be honest.

    Cheers,
    Pärtel
     
  3. BigGameCompany

    BigGameCompany

    Joined:
    Sep 29, 2016
    Posts:
    21
    So in play mode after i have moved the body effects to where i want them, how do i save them?
     
  4. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    200
    Hi, I'm trying to use Final IK with Opsive's TPC to start a sort of "injured" state when taking damage. Currently I'm activating the Amplifier component to effect the Right Foot and and Body of the character, and it kind of works, but looks a little weird when walking (but pretty good when running - like Laura Dern running from the raptors in Jurassic Park). Is there anything else you could recommend for this purpose - just using Final IK without creating new animations to add a "limp" or injury to walk cycle?
     
    Last edited: Aug 18, 2019
  5. Cyrusc

    Cyrusc

    Joined:
    Sep 27, 2014
    Posts:
    14
    Hi Partel, I know you get asked a lot about UMA and I'm sorry to continue the trend.

    When hooking up the VRIK to a UMA default male, there are extra bones in UMA that cause the IK to look messed up on the shoulders/arms in certain poses (see the left arm on the attached image). These bones ([Left/Right]ArmAdjust/[Left/Right]ShoulderAdjust) can be manually adjusted to make it look better in certain poses, the right arm on the attached image is an example of trying to modify the bones to make it look better.

    Is there any way to account for these bones in the IK solving? I tried adding twist relaxers that referenced the extra bones but that didn't work.

    upload_2019-8-18_13-5-37.png
    upload_2019-8-18_13-8-29.png
     
  6. rmon222

    rmon222

    Joined:
    Oct 24, 2018
    Posts:
    31
    Hi Partel, I'm running the VRIK (Hit Reaction) scene. I'm trying to not call Solve() every frame but instead only on raycast hits. The result is the model becomes unpredictable. Does VRIK.UpdateSolver() have to run every frame? Any suggestions on how to Solve() only when needed?
     
  7. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,938
    Hey,
    Dragging effectors in Scene View was designed just for purpose of testing the solver, since you can't do that in a built game anyway.
    But it is possible, with a couple of extra scripts, please import this package.
    Create a FFBIKEffectorState object (Create/Final IK/FBBIK Effector State), that is a ScriptableObject that will store your effector values. Then add SaveLoadEffectorState.cs to your character, assign the "IK" field and the created FBBIKEffectorState object, then you can right-click on the component header to select "Save Effector State" and "Load Effector State". It currently only saves/loads effector positions, rotations and position/rotation weights. If you need other parameters and can't figure out how to add them to FBBIKEffectorState.cs, please let me know.

    Hey,
    Are you able to get the Amplifier to look good for the walk if you changed some parameters? I mean you could probably have one Amplifier to walk and another to run, then blend their weights based on which animation is playing. Or have 1 Amplifier and just tween the parameters.

    Hey,
    I just updated my UMA integration, added VRIK support, but didn't see any issues like that with the shoulders. Maybe they have been fixed for the next version of VRIK. If you'd like to check it out sooner rather than later, please PM me with your invoice number and I'll send you the latest.

    Hey,
    You can disable the VRIK component in Start and call ik.solver.Update() whenever you need to update it.
    IK needs to run every frame when animation is applied because animation just overwrites everything. If you don't have any animation, you'll also have to call ik.solver.FixTransforms() before ik.solver.Update() to avoid the solver solving additively on top of it's own results.

    Best,
    Pärtel
     
  8. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,938
    Hey guys, I will be out of town until 30th of August. Sorry about the inconvenience, please leave your questions here and I will attend to them as soon as I get back.
     
    Deckard_89 likes this.
  9. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    82
    Hey,

    thanks Partel, I was ignoring there was an Arm Ik, I tried it and it's working really well for my game !

    Good holidays to you :)
    Jonathan
     
  10. rmon222

    rmon222

    Joined:
    Oct 24, 2018
    Posts:
    31
    Thanks for the response. It worked.
     
  11. WojciechWlodyka

    WojciechWlodyka

    Joined:
    Jun 12, 2019
    Posts:
    4
    Hello,

    Recently I wanted to create pipe of vaccum cleaner with FARBIK to make it look and feel like realistic. I have managed to make it reasonably nice but for final effect it would look better with physics, so there is my question:

    Has anyone tried combine FABRIK and physic? I have when im adding rigibody to one of pipe’s bone everything freaks out as shown on the pictures. Is where any way to add psyhics and keep it reasonably good?




    This is my pipe without rigibody running pure FABRIK.


    This is what happens if i add any rigibody and boxcolliders to the bones.

    Thanks for help in advance.
     
  12. MrLeggo

    MrLeggo

    Joined:
    Feb 16, 2018
    Posts:
    20
    Hi all,

    I'm using VRIK with Oculus Quest. I don't need a full rigged/meshed character, I just need to approximate where the chest/stomach would be. I want to attach an object to the stomach for a VR project.

    At the moment I have used the rigged pilot figure and attached the stomach object to the spine and turned the pilot mesh renderer off. This sort of works, occasionally the object doesn't move with the headset, but the biggest issue is, that it seems to move with the head, rather than the approximated chest.

    Any suggestions on how I can get a better approximation of the chest? Or what the best way to attached the stomach the object would be?
     
  13. DevelopedReality

    DevelopedReality

    Joined:
    Jul 14, 2015
    Posts:
    20
    Hey Partel,

    I'm having some trouble coupling AimIK with the Unity Animator. Basically, I'm trying to set up a snake model that will strike the player (as a frog) in a scene. I have a strike animation that moves the snake's head from an upright position forward into the ground (where it should hit the frog's collider). I'm using AimIK to make the snake head look at the player's position while striking, modifying the weight of AimIK through animation events (high weight when head is high, lower weight as it strikes .

    The issue I'm having is that when the snake's head is close to hitting the player, it starts bouncing backwards and doesn't complete the animation even though the target it's aiming at is actually below the frog's position.

    Here's a short vid of the results:



    A pic of the AimIK setup is also uploaded. Any suggestions? Is this just the wrong tool for the job?

    Thanks!
    Kai
     

    Attached Files:

  14. DevelopedReality

    DevelopedReality

    Joined:
    Jul 14, 2015
    Posts:
    20
    Ignore this - figured it out. Thanks!
    -K

     
  15. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,938
    Hey,
    Sorry, you can't just add physics to IK, you'll need to choose either IK or physics based solution.
    You could try setting it up entirely with physics, with no IK. Use kinematic rigidbodies as your "IK targets". Add FixedJoints between parts of the hose and those kinematic rigidbodies.
    You can tweak rigidbody parameters like drag and gravity to get the hose behaving like it should.
    There are probably a couple of rope physics tools on the Store that might be worth looking into too.

    Hey,
    Using VRIK just to approximate holster positions is a bit of an overkill, especially on Quest where you must fight hard for every microsecond. What you ought to do is make a neck model, something like this:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class NeckModel : MonoBehaviour
    6. {
    7.     public Transform cameraRig;
    8.     public Transform centerEyeAnchor;
    9.     [Range(0f, 180f)] public float maxForwardAngle = 45f;
    10.     public Vector3 neckOffset = new Vector3(0f, -0.2f, -0.1f);
    11.     [Range(0f, 1f)] public float neckStiffness = 0.75f;
    12.  
    13.     private Vector3 forward;
    14.     private Vector3 chestForward;
    15.  
    16.     private void Start()
    17.     {
    18.         forward = cameraRig.forward;
    19.         chestForward = forward;
    20.     }
    21.  
    22.     void LateUpdate()
    23.     {
    24.         if (maxForwardAngle < 180f)
    25.         {
    26.             Vector3 faceDir = Vector3.Cross(centerEyeAnchor.right, Vector3.up);
    27.  
    28.             Vector3 faceDirLocal = Quaternion.Inverse(Quaternion.LookRotation(forward)) * faceDir;
    29.             float angle = Mathf.Atan2(faceDirLocal.x, faceDirLocal.z) * Mathf.Rad2Deg;
    30.  
    31.             float rotation = 0f;
    32.             float maxAngle = maxForwardAngle;
    33.  
    34.             if (angle > maxAngle)
    35.             {
    36.                 rotation = angle - maxAngle;
    37.             }
    38.             if (angle < -maxAngle)
    39.             {
    40.                 rotation = angle + maxAngle;
    41.             }
    42.  
    43.             Quaternion angleA = Quaternion.AngleAxis(rotation, Vector3.up);
    44.             forward = angleA * forward;
    45.          
    46.             chestForward = Vector3.Slerp(faceDir, forward, 0.5f);
    47.         }
    48.  
    49.         Quaternion chestRotation = Quaternion.LookRotation(new Vector3(chestForward.x, 0f, chestForward.z));
    50.  
    51.         Vector3 neckPos = centerEyeAnchor.TransformPoint(neckOffset);
    52.         neckPos = Vector3.Lerp(neckPos, centerEyeAnchor.position + chestRotation * neckOffset, 1f - neckStiffness);
    53.     }
    54. }
    55.  
    Then you can use neckPos and chestRotation to place your holsters:

    Code (CSharp):
    1. holster.position = neckPos + chestRotation * holsterOffsetFromNeck;
    Cheers,
    Pärtel
     
  16. Cyrusc

    Cyrusc

    Joined:
    Sep 27, 2014
    Posts:
    14
    Would having an external script that simulates IK/Body Position like that be the best option for keeping a VRIK character without locomotion in the correct position relative to their play space?
     
  17. marvalshot

    marvalshot

    Joined:
    Dec 29, 2013
    Posts:
    157
    Is this compatible with 2019.3 Beta yet?
    'Animator' does not contain a definition for 'BindSceneProperty' and no accessible extension method 'BindSceneProperty' accepting a first argument of type 'Animator' could be found (are you missing a using directive or an assembly reference?)
     
  18. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,938
    Hey,
    Might be worth a try, yes.

    Hey,
    Yes, unfortunately Unity changed their API without adding it to the automatic API updater like they usually would, but please import this hotfix for that bug.

    I will be submitting new versions of FIK and PM for review this week.

    Best,
    Pärtel
     
    Meheraj7, nehvaleem and marvalshot like this.
  19. cspid

    cspid

    Joined:
    Apr 25, 2014
    Posts:
    21
    Hello, I'm having some issues with foot placement on a quadruped when descending steps. I'm attaching a clip of the issue and a screenshot of my quadruped inspector window - please let me know if you have any thoughts.

    Thanks,
    Carl
     

    Attached Files:

  20. HoneyTribe

    HoneyTribe

    Joined:
    Mar 7, 2013
    Posts:
    20
    Thanks for the reply @Partel-Lang
    We took your advice and used the profiler. I understand you didn't make the controller plugin we are using so can't comment on that, but maybe you can see something that stands out compared to how Final IK normally works in these profiler screenshots? One from the game running ok, and one from the periodic drops in performance that happen. We're pretty sure it's the combo of Final IK and Ultimate Player Controller that cause the drops, but we still don't know how to fix it so we can use Final IK smoothly. I'll ask the devs of the controller plugin too.

    Screen 1: Game running ok
    https://i.paste.pics/ace7b43ae3db8369d2892a9ea45322fd.png



    Screen 2: drop in FPS
    https://i.paste.pics/6cdda456cb3c2d8b66b80f08daa46710.png


    Thanks,
    Shaz
     
  21. alexishcf

    alexishcf

    Joined:
    Sep 2, 2018
    Posts:
    5
    Hey! Nice asset, really needed something like that for my VR game!

    I have an issue tho : I'm using VRIK to animate my full-body character. The player has a weapon, which is a child of the right hand (which is animated by VRIK) and when he fires, I use the weapon.position & weapon.forward to raycast the shot. The weapon.position is fine, but the weapon.forward for some reasons is wrong like 5% of the time (the bullet goes up instead of going forward). I suspect that for some reasons, VRIK perform an extremely fast rotation or something which could explain this change in the weapon.forward. Is it possible that it is the case? And how may I fix this?

    Thank you! And keep up the good work!


    (left vector is the weapon.forward / right vector is the weapon.position)
    First line is when everything's fine, second line is when the weapon.forward suddenly goes wrong, position is a little different too although I am not moving
     
  22. YuriyVotintsev

    YuriyVotintsev

    Joined:
    Jun 11, 2013
    Posts:
    30
    Hi, I am using VRIK in my game and my character is spawned and despawned using object pool. When character spawned first time everything is ok, but after despawn and spawn again it's feet are rotated by arbitary angle. How should I reset feet position when respawning character?
    feet.png
     
  23. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,938
    Hey,
    From that screenshot it appears that Physics.CapsuleCast() takes abnormally long time. Maybe it is the capsule casts made by the Grounder, but it should not take nearly that long, looks like a Unity physics bug. Could try switching Grounder quality to "Fastest" and see if the drop goes away to make sure that is indeed the issue.

    If that's not the case, please run the Profiler in Deep Profile mode and then click on Save in the Profiler window and send me that binary file so I could load it up here with some more information.

    Hey,

    It looks a lot like an issue with the update order of things. I think you are firing the bullet before VRIK has updated for the frame, so your bullet fires from the last frame's position of the gun so it just lags a frame behind.

    You can use the ik.solver.OnPostUpdate delegate to fire that bullet:

    Code (CSharp):
    1. void Start() {
    2. ik.solver.OnPostUpdate += AfterVRIK;
    3. }
    4.  
    5. void AfterVRIK() {
    6. if (triggerDown) FireBullet();
    7. }
    Hey,
    Looks like a problem that has probably been fixed for the next version. I am submitting it to the Store for review tomorrow, but it will take a little time. If you are in a hurry, please PM with your invoice number.

    Best,
    Pärtel
     
  24. alexishcf

    alexishcf

    Joined:
    Sep 2, 2018
    Posts:
    5
    Thank you, solved my issue!
     
  25. PUCKERS

    PUCKERS

    Joined:
    Jan 8, 2016
    Posts:
    2
    Hi Pärtel, thanks for the awesome work on Final IK!

    I have been playing around with Final IK and had a few questions
    - is possible to add pole targets to individual bones/joints using FABRIK for example a mech leg with more than 3 bones
    - is it possible to increase joint stiffness with FABRIK?

    I don't seem to be able to control the rotation enough. For example if the far left is rest position, when lifting the foot, the upper most part of the leg doesn't rotate much resulting in everything squashing up which results in jerky movement. I was hoping to increase stiffness of the middle section to force the upper section to rotate more.

    upload_2019-9-5_23-26-17.png

    I hope I am explaining this well. :eek:

    Regards
    peter
     
  26. HoneyTribe

    HoneyTribe

    Joined:
    Mar 7, 2013
    Posts:
    20
    Thanks for the offer of helping further, I appreciate it :) The good news is that we also contacted the dev of Ultimate Character Controller and his recent update fixed the integration with Final IK. So now Final IK works perfectly in our game. Final Ik is a really good plugin it adds a lot of immersion to games and with a simple set up too. Cheers!

    Shaz
     
    Partel-Lang likes this.
  27. AylaBVR

    AylaBVR

    Joined:
    Jun 21, 2019
    Posts:
    4
    Is it possible to modify the script for recoil that is in one of the examples for an FBBIK character so it will work with a VRIK character? And if so how would I do it? I've been trying to do it myself but can't figure it out since the VR solver doesn't have any references to effectors.
    Thanks.
     
  28. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,938
    Hey,
    It is not possible to have a pole target, but it is possible to create sort of a "magnet" for the FABRIK algorithm:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using RootMotion.FinalIK;
    5.  
    6. public class FABRIKMagnet : MonoBehaviour {
    7.  
    8.     public FABRIK ik;
    9.  
    10.     public int boneIndex = 1;
    11.     [Range(0f, 1f)] public float weight = 1f;
    12.  
    13.     void Start ()
    14.     {
    15.         ik.solver.OnPreIteration += OnPreIteration;
    16.     }      
    17.    
    18.     void OnPreIteration(int iteration)
    19.     {
    20.         ik.solver.bones[boneIndex].solverPosition = Vector3.Lerp(ik.solver.bones[boneIndex].solverPosition, transform.position, weight);
    21.     }
    22.    
    23. }
    So attach that script to a new gameobject and it will try to pull the bone at index boneIndex towards it's position.

    Oh, thanks, that is great news! :)

    Hey,
    Wouldn't it be easier to add recoil just to the hand target? It is parented to the hand controller so you should be able to move it back temporarily (recoil). Something like this (untested code just from the top of my head):

    Code (CSharp):
    1. public Vector3 recoilDir;
    2.     public float recoilMag = 1f;
    3.     public AnimationCurve recoilCurve;
    4.     public Transform handTarget;
    5.  
    6.     private Vector3 defaultLocalPos;
    7.     private float recoilTimer;
    8.     private float recoilDuration;
    9.  
    10.     private void Start()
    11.     {
    12.         defaultLocalPos = handTarget.localPosition;
    13.         recoilDuration= recoilCurve.keys[recoilCurve.keys.Length - 1].time;
    14.     }
    15.  
    16.     public void StartRecoil()
    17.     {
    18.         recoilTimer = 0f;
    19.     }
    20.  
    21.     private void Update()
    22.     {
    23.         if (recoilTimer > recoilDuration) return;
    24.         recoilTimer += Time.deltaTime;
    25.  
    26.         handTarget.localPosition = defaultLocalPos + recoilCurve.Evaluate(recoilTimer) * recoilDir * recoilMag;
    27.     }
    Best,
    Pärtel
     
  29. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,938
    Hi all!

    So finally I have managed to push the next versions of both Final IK and PuppetMaster! :)

    What kept it so long was mostly the new high speed prop API of PuppetMaster and the new Baker feature added to both FIK and PM.

    I have also done a complete revision and update of the documentation and added in all the missing pages for VRIK, ArmIK, LegIK and others. Check it out here.

    Please take a moment to check out the new Baker tool:




    As ever, with new versions there might be some unexpected bugs so please let me know as soon as you find any.

    Cheers,
    Pärtel
     
  30. BSP-Lab

    BSP-Lab

    Joined:
    Dec 11, 2017
    Posts:
    1
    Hi Pärtel,

    I'm having the same problem with MakeHuman characters when adding VRIK, where the stomach position bulks. I saw that you sent somebody a PM with a fix for this, could you also provide me with such fix or make it public? Thank you in advance!

    Marte

     
  31. BrunoMikoski

    BrunoMikoski

    Joined:
    Feb 25, 2014
    Posts:
    3
    I'm trying to create a mechanical arm that rotates 360 degrees around the base, but I'm not sure if my setup or wrong or what I'm trying to do is to restrict for the IK itself, does anyone has an idea of how I should tackle this?

    In this video you can see the setup and the movement that I want my mechanical arm executes:



    What would be the best way to achieve that? I noticed that if I remove the fix transform things gets better, but I guess my target still have to kinda of do circular movements, otherwise cannot solve the IK
     
  32. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,938
    Hey,
    That fix is already published, please download the latest version from the Store.

    Hey,
    I think when you disable "Use Limits" on that first rotation limit, it will work better. It will still be a hinge joint, but free to spin around the axis.
    Also, FABRIK might be better for that rig.

    Cheers,
    Pärtel
     
  33. YuriyVotintsev

    YuriyVotintsev

    Joined:
    Jun 11, 2013
    Posts:
    30
    Hi,
    There is one issue with initial calibration of character with VRIK and teleportation when locomotion is enabled. When there is no feet trackers character after calibration streches towards hands and head and slowly walk towards normal position. Here is screenshot:
    bug.png
    What should I do to reset feet position right after calibration? Same when I teleport character's head and hands.
     
  34. Ceciaman

    Ceciaman

    Joined:
    Jul 30, 2013
    Posts:
    11
    Hi I'm creating a 4-player multiplayer game with oculus rift s and unity and FinalIK Everything is going well, but I have problems with virtual movements (for example climbing a ladder or using cars) because the player stays with his feet at floor level. What can I do?
     
  35. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,938
    Hey,
    After you calibrate, move the root to the horizontal position of the head target and reset the solver:
    Code (CSharp):
    1. Vector3 toHeadTarget = ik.solver.spine.headTarget.position - ik.references.root.position;
    2. toHeadTarget.y = 0f;
    3. ik.references.root.position += toHeadTarget;
    4.  
    5. ik.solver.Reset();
    ik.solver.Reset() should be called also after you teleport the IK targets (also teleport the root of the character by the same delta position/rotation).

    Hey,
    I have no built in solution for this as there are so many ways to make virtual movements. When you climb a ladder, just make sure the root keeps up. For example if the character has a rigidbody controller with a capsule collider, you can parent the root of that avatar to the controller so when it goes up, so will the avatar. Same with the car, parent the avatar to the car.

    Best,
    Pärtel
     
  36. lawsonh

    lawsonh

    Joined:
    Jul 25, 2018
    Posts:
    6
    Hi Partel,

    Thank you so much for continuing to be active in this thread and giving support.

    My question is about FABRIK but probably also applies to the other solvers. I want to use the fix transform option with FABRIK and be able to detect collisions between the IK'd object and the world. But it seems that the position update of Final IK is done in LateUpdate so FixedUpdate will just get the default position of the object instead of the IK'd position.
    Is there any way to solve this?

    Thanks

    Edit: nvm, I was doing something wrong. everything works out of the box.
     
    Last edited: Sep 15, 2019
  37. spelafort

    spelafort

    Joined:
    May 8, 2017
    Posts:
    6
    Hi Partel,

    Thanks for keeping this wonderful tool alive!

    I'm trying to work out a solution to make an almost 'liquid' body (like an amoeba). Thus far I've made essentially an eight-armed starfish armature and attached it to... well, a pancake/blob.

    Using the spider robot example I was able to get something that moves around in a convincing way. But I'm trying to work out how I could further stretch the model in particular directions on the basis of player input-- just as amoebas are able to profoundly alter their shape through the use of pseudopods:

    https://www.biology-online.org/dictionary/Pseudopod

    I saw that in the VRIK there's a way to stretch bones. Is there a way to do this using FABRIK or CCDIK? Or am I better off trying something else entirely?

    thanks!
     
  38. Nikmady

    Nikmady

    Joined:
    Mar 31, 2019
    Posts:
    4
    Hello. I'm a new in C# a little.
    Give an example please how to Use your script for setup "OnCollisionEnter"- interaction. Or better OnTriggerEnter/Stay - interaction.

    In your code there is only a Ray-cast(Hit Reaction) sample. I very need to collide my VRIK-Avatar body with another colliders in scene.
    If be the more concrete: I need to punch(via HTC Vive controller) another Newtwork player and He is should react on it(to make a HitReaction).
    Thank you.
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      87.9 KB
      Views:
      33
  39. alexishcf

    alexishcf

    Joined:
    Sep 2, 2018
    Posts:
    5
    Hello!

    How can I fix the non-dominant hand of the character on the weapon grip using VRIK? I've seen Hand Poser, Interaction Area, AimIK, Position Constraint... but not sure which one I should be using :/

    Another question: just updated FinalIK and am using the VRIK LOD 1, arm length mlp doesn't seem to work anymore (from doc : LOD 1: Shoulder solving, stretching plant feet disabled, spine solving quality reduced), not sure if it means shoulder solving is disabled or if it only does shoulder solving?

    Thanks for your help!
     
    Last edited: Sep 19, 2019
  40. HoneyTribe

    HoneyTribe

    Joined:
    Mar 7, 2013
    Posts:
    20
    Hey @Partel-Lang, can you recommend an asset store player & camera controller plugin that works well with Final IK? We seem to be having continual issues with Opsive's Ultimate Character Controller so are now looking at alternatives.

    Thanks
    Shaz
     
  41. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,938
    Hey,
    There's no automatic stretching for CCD/FABRIK, but you can adjust the localPosition of the leg bones for example, something like bone.localPosition = stretchMlp * defaultBoneLocalPosition in LateUpdate to stretch the leg bones, CCD/FABRIK will adapt to that.

    Hey,
    Not sure if it could be done realistically with IK. I mean you could probably simulate it to a certain degree but it would be so much more realistic with physics. If you happen to have PuppetMaster, it contains a demo like this. (can be found in Plugins/RootMotion/PuppetMaster/_Integration)

    Hey,
    Make a duplicate of the first person model, pose the hand of the duplicate to the weapon. Then parent the hand to the weapon and delete the rest of the duplicate. Your IK target is parented to the hand controller so you will be able to match it's position/rotation with that of the duplicated hand that was parented to the weapon when the grip button is down.

    Code (CSharp):
    1. public Transform gripTarget;
    2. [Range(0f, 1f)] public float gripWeight;
    3.  
    4. private Vector3 defaultLocalPosition;
    5. private Quaterion defaultLocalRotation;
    6.  
    7. void Start() {
    8. defaultLocalPosition = ik.solver.leftArm.target.localPosition;
    9. defaultLocalRotation = ik.solver.leftArm.target.localRotation;
    10. }
    11.  
    12. void LateUpdate () {
    13. ik.solver.leftArm.target.localPosition = defaultLocalPosition;
    14. ik.solver.leftArm.target.localRotation = defaultLocalRotation;
    15.  
    16. ik.solver.leftArm.target.position = Vector3.Lerp(ik.solver.leftArm.target.position, gripTarget.position, gripWeight);
    17.  
    18. ik.solver.leftArm.target.rotation = Quaternion.Slerp(ik.solver.leftArm.target.rotation, gripTarget.rotation, gripWeight);
    19. }
    For the fingers, you could use the HandPoser. Add the HandPoser component to the first person model's hand bone, assign the hand that was parented to the weapon as handPoser.poseRoot and call handPoser.weight = gripWeight;

    About VRIK LOD, stretching and shoulder solving is supposed to be disabled for LOD level 1 to save performance. Please use LOD 0 until the character is far enough for the player to not notice the difference.

    Hey,
    I do not have much experience with 3rd party character controller and AI packages, sorry, I usually just roll my own just to make sure I have 100% understanding and control over what is the most important part of the game. I only load them up when I hear there is something wrong with their FIK integration. But they should all work fine with FIK as far as I know.

    Cheers,
    Pärtel
     
    spelafort likes this.
  42. alexishcf

    alexishcf

    Joined:
    Sep 2, 2018
    Posts:
    5
    Hey Partel,

    Thank you for your answer, I am not sure to get it tho - I do not want the controller to have an impact on the "fixed hand"'s position, therefore I have this code:

    Code (CSharp):
    1.     [SerializeField]
    2.     Transform grip;
    3.  
    4.     RootMotion.FinalIK.VRIK vrIK;
    5.  
    6.     // Start is called before the first frame update
    7.     void Start()
    8.     {
    9.         vrIK = GetComponent<RootMotion.FinalIK.VRIK>();
    10.         vrIK.solver.OnPostUpdate += F;
    11.  
    12.     }
    13.  
    14.     // Update is called once per frame
    15.     void F()
    16.     {
    17.         vrIK.solver.rightArm.target.position = grip.position;
    18.     }
    So that the right hand is always on the grip, problem is that when the player moves, the hand is not really fixed (
    )

    What should I do to have the hand on the grip independently of the player moving?

    Thank you!
     
  43. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    859
    Hello Pärtel,
    Hopefully it would be ok to ask the following: With final IK is it possible, or are there demos on how to create a dancing animation, eg swing hips, move feet/arms maybe, control limbs? I am looking to make my character move limbs in a sequence to give some unique dance moves, has that ever been considered, or done before?
    Thanks for any input on this.
     
  44. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,938
    Oh, I misunderstood, sorry! Looks like the problem is just that VRIK is unable to reach the hand target when that walking animation starts. If you increase the "Arm Length Mlp" for that arm in VRIK settings, the problem will probably disappear. You can also use the automatic arm stretching built in to VRIK - go to the "VRIK (Basic)" demo and copy the "Stretch Curve" over from the Pilot's arm settings to your own to get a good optimal value.

    Could also switch to FullBodyBipedIK, that is able to pull the body along if the arm doesn't reach.

    Hey,
    I have not tried it myself nor heard of anyone who has, but technically, you should be able to use the FullBodyBipedIK component and it's effectors. You can just assign gameobjects as IK targets for the hands, feet, body, thighs or shoulders, then you'd need a way to animate those gameobjects to move how you'd like them to. Unity's Animation Window can help with that or maybe you can drive them by script.

    Cheers,
    Pärtel
     
  45. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    859
    Hi, I was doing some more research, there is a procedural dance test available that uses Unity IK, it works really well... I am curious if I can convert/carry some of the functionality over to final IK. I think so!
    Sample gif of some dance tests (these are procedural,scripted) :)
    gif.gif
     
  46. crydrk

    crydrk

    Joined:
    Feb 10, 2012
    Posts:
    73
    Forgive me if this has been answered 50 times in the 81 pages.

    I'm trying to use limb IK for getting a mocap character to wave, point and beckon to a certain point. I've scripted up everything I need to blend nicely into the IK controlling it. I'm currently landing on 50% weight to try to get bot the aim as well as the intent from the animation. With that weighting, I get neither the exact animation nor exact aims.

    Any thoughts on ways to combine these better?
     
  47. chgeorgiadis

    chgeorgiadis

    Joined:
    Jan 30, 2018
    Posts:
    11
    I have a humanoid AVATAR and some fbx (or bvh) files which are animation made from MoCap with Kinect. But they have problems like arms inside body or inside the other hand etc. Can i use Final IK and the constraints in order to prevent to make these moves and stops for example the hand in the chest?
     
  48. victorytoad

    victorytoad

    Joined:
    Oct 14, 2018
    Posts:
    1
    Hey there friends. I sent this via email to FinalIK but after finding this forum I'm thinking this may be a better place.

    I'm creating a character controller rather similar to the Bot character in the Grounder demo. My aim is to have a third person controlled 4 legged robot that walks around uneven terrain believably, using FinalIK to ground the feet and eliminate foot slide.

    I've tried copying the structure and component values of the demo bot exactly, and I'm still getting issues. My character seems to be permanently rotated 45 degrees on play. Animations don't seem to be blending correctly (if at all). The motion of the limbs is not at all desired. I've attached a few screenshots.

    It really feels like I'm doing something simple, yet critical, wrong. Thank you for any assistance. Looking forward to using your product successfully
     

    Attached Files:

  49. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,105
    Hi Pärtel,

    apologies for posting this on a Saturday - it's not super-urgent but I'm hoping for some support on this because it looks I can't figure this out on my own. It could also be a bug but I'm not sure. This is on FinalIK 1.9.

    Here's a video illustrating the issue:



    I believe the issue is Leg Length Mlp stretching the leg unnecessarily when set to 1. I use the Stretch Curve from the Pilot, as recommended. And the issue occurs in the base pose (without moving the trackers from their calibration position).

    When I hook up VRIK without "offsets", i.e. with the calibration done as recommended (empty transforms at the positions of the bones parented to the controllers), the legs immediately get rotated backwards, about 180°. I can compensate for that by moving the leg tracker forward, or by using an offset where the bend goal position is a little forward compared to where the bone is. I believe for bend goal, that's probably the way to do it, anyways - but even with the offsets activated, the knees still bend quite a bit - while the pose shouldn't require that.

    So I believe this happens because the knees are stretched (made longer than they really are), and then need to bend to compensate for that.

    At first, I thought I just need to change Leg Length Mlp from 1 to something like 0.85. That does fix this issue shown in the video - but it creates another problem: With 0.85, when moving the foot up a little, the leg shrinks (i.e. becomes shorter than it really is). That's the behaviour I would expect with a value smaller than 1; I just don't expect a value of 1 to stretch the leg when not necessary, and using 0.85 was an attempt to isolate the issue a little more. In the video, with clothes, the "shrinking" isn't as obvious - but with my naked base model, the heel then gets distorted in a very strange way.

    Any idea what might be going wrong here, and how I can fix it? Or is this maybe a bug in 1.9?

    Sunny regards,
    Jashan
     
  50. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,938
    Hey,
    If it can be done with Unity IK, it can be done with Final IK. If you use the BipedIK component, that was designed to work as close as possible to Unity IK, even has basically the same API except for that you should use LateUpdate instead of OnAnimatorIK.

    Hey,
    I'm sorry, I don't think I understood you very well, could you please send a video of what you have going on there?
    Did you mean you had some character with mocap idle or something and you needed it to wave and point with LimbIK?
    Or is the animation already waving and pointing, just need to aim it? In the latter case, you should use AimIK and AimController.cs (check out the "Aim Controller" demo) and enable "Use Animated Aim Direction" in AimController so it would make AimIK work in additive mode basically, reorienting the animation. Add just the spine bones to AimIK, assign the last spine bone as Aim Transform and set the forward pointing axis of that bone as Axis.

    Hey,
    If you get the latest version, you'll find the Baker tool, that will enable you to make some procedural IK/FK fixes and bake them as new animation clips.
    For example to offset the animation of the arm bones, you could use this script:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class ForwardKinematics : MonoBehaviour
    6. {
    7.     [System.Serializable]
    8.     public class Offset
    9.     {
    10.         [SerializeField][HideInInspector] public string name;
    11.         public HumanBodyBones bone;
    12.         public Vector3 rotationOffset;
    13.     }
    14.  
    15.     public Offset[] offsets;
    16.  
    17.     private Animator animator;
    18.  
    19.     private void Start()
    20.     {
    21.         animator = GetComponent<Animator>();
    22.     }
    23.  
    24.     private void LateUpdate()
    25.     {
    26.         foreach (Offset offset in offsets)
    27.         {
    28.             animator.GetBoneTransform(offset.bone).localRotation *= Quaternion.Euler(offset.rotationOffset);// * animator.GetBoneTransform(offset.bone).localRotation;
    29.         }
    30.     }
    31.  
    32.     private void OnDrawGizmosSelected()
    33.     {
    34.         foreach (Offset offset in offsets)
    35.         {
    36.             offset.name = offset.bone.ToString();
    37.         }
    38.     }
    39. }
    Add some arm bones and apply a bit of rotational offset to keep them away from the body, then run it through the Baker.

    It would also be possible to make a script that reads the vector from chest to hand, checks the magnitude of that vector and if it is too small, move the hand out along the same vector using LimbIK.

    Hey,
    Please make sure that the root of the bot is rotated so the blue axis points forward and green axis up. Also make sure the Grounder gameobject has the same rotation relative to the bot.

    Hey,
    Did this issue appear when you updated from 1.8 to 1.9?
    Would it be possible for you to package that character fbx in a scene with the VRIK setup you were using and send it over via support@root-motion.com?

    Best,
    Pärtel