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

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    @Partel-Lang Hi, this might be the easiest question asked ;)

    How do I make a swinging rope? So when moving the top the bottom swings around with a rigid body on the last rope Transform.

    Do I use CCD IK? If so how do I un-constrain the bottom?

    Thanks.
     
  2. MrG

    MrG

    Joined:
    Oct 6, 2012
    Posts:
    368
    Last edited: Apr 27, 2017
  3. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
  4. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    You could try this script:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using RootMotion.FinalIK;
    4.  
    5. public class FABRIKMagnet : MonoBehaviour {
    6.  
    7.     public FABRIK ik;
    8.     public int boneIndex;
    9.     public int maxIteration;
    10.  
    11.     void Start() {
    12.         ik.solver.OnPreIteration += OnPreIteration;
    13.     }
    14.  
    15.     void OnPreIteration(int i) {
    16.         if (i > maxIteration) return;
    17.         boneIndex = Mathf.Clamp(boneIndex, 0, ik.solver.bones.Length);
    18.  
    19.         ik.solver.bones[boneIndex].solverPosition = transform.position;
    20.     }
    21. }
    Add it to a gameobject that you want to become the magnet. It's not a target though, the results will not be perfect.

    Another solution would be to try the FABRIKRoot, that will combine multiple FABRIK chains, see the "FARBIK Root" demo.

    Also, you could set the tail up with rigidbodies and joints, attach certain parts to the targets with additional joints. You can disable gravity for the tail rigidbodies, add a lot of drag and stuff like that to make it appear more kinematic if you need to.

    Cheers,
    Pärtel
     
  5. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    Thanks for the quick reply. Just a general question. Do you think its would make sense to use walking and running animations in combination with VRIK (does VRIK allow blending?) to get the avatars to move a bit more natural?

    The issue I have when setting the locomotion weight to 0, is that the Avatar controlled by VRIKs feet stay pinned to one location. If I try to move, the Avatar doesn't follow and get "stretched" between the feet location and the headset location.
     
    Last edited: Apr 29, 2017
  6. ryancampfire

    ryancampfire

    Joined:
    Jan 4, 2017
    Posts:
    31
    I think this doesn't address my goal, which is more about making the final segments of the chain ease into matching the orientation of the target. Like, if the down direction of the target is pointing a certain direction, I want the chain to approach from that direction rather than have a hard bend right where it meets the target.

    I'm trying some other things in that OnPreIteration event to see how I can massage the approach.
     
  7. DryginUnity

    DryginUnity

    Joined:
    Nov 20, 2016
    Posts:
    7
    Hey, thanks for your time again, I see that in this new code only the OnAnimatorMove function is changed, but it sends the Move method of the CharacterBase two parameters, when it only accepts one, can you please send the Move method too? because I believe you've changed it and forgot to update it aswell, thanks in advance.

    void OnAnimatorMove() {
    // For not using root rotation in Turn value calculation
    Vector3 f = animator.deltaRotation * Vector3.forward;
    deltaAngle += Mathf.Atan2(f.x, f.z) * Mathf.Rad2Deg;

    characterController.Move(animator.deltaPosition, animator.deltaRotation); // THIS ONE
    }
     
  8. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    If the legs are not moving when you set locomotion weight to 0, that is because an idle animation is playing. You'll need to use walking/running animations with root motion or move the character's root by script to catch up with the HMD.

    Hey,
    There are no algorithms in the package that can match both position and rotation of the target. CCD/FABRIK match the position, AimIK matches the rotation. Have you tried the rigidbodies and joints approach?

    Hey,
    Are you sure you didn't change the Move function to accept one when you tried to fix it yourself? Because in my project it still uses 2 params.

    Cheers,
    Pärtel
     
  9. DryginUnity

    DryginUnity

    Joined:
    Nov 20, 2016
    Posts:
    7
    Hey! appreciate your quick replies :)
    Yes I'am pretty sure, this is the Move method I've got!

    // When the Animator moves
    public override void Move(Vector3 deltaPosition) {
    // Accumulate delta position, update in FixedUpdate to maintain consitency
    fixedDeltaPosition += deltaPosition;
    }

    Thanks in advance.
     
  10. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    i have a punch animation that i want to punch a wall.. the animation is passing through the wall even with rigidbodys and colliers. So my question is, can i use ik to stop the animation when it detects the wall / colliders ?
     
  11. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Make a backup, then reimport those character controller scripts from the latest.

    Hey,
    Check out the "Motion Absorb" demo, see if it helps.

    Cheers,
    Pärtel
     
  12. anthony_ribot

    anthony_ribot

    Joined:
    Mar 5, 2015
    Posts:
    3
    Hello guys,

    I would like to know how can I set bend normal for VRIK's solvers (arms and legs).
    I did this easily with FullBodyBipedIK by setting [defaultChildDirection/defaultLocalDirection] for each 'IKConstraintBend' at "OnPostInitiate" update delegate.

    But I don't really see how to acheive this with the VRIK component.
    I would also be interested to do the same with BipedIK.

    BTW : best asset ever :p

    Best Regards,
    Anthony
     
  13. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    548
    Hi Partel,

    Could you tell me what is wrong in this script to aim based on a aiming bool?

    Code (CSharp):
    1.     // Update is called once per frame
    2.     void LateUpdate () {
    3.  
    4.  
    5.         if (Aiming) {
    6.             lefthandweight=Mathf.Lerp (lefthandweight, 1f, Time.deltaTime * smooth);
    7.          
    8.             righthandweight=Mathf.Lerp (righthandweight, 0f, Time.deltaTime * smooth);
    9.            
    10.             aimdweight=Mathf.Lerp (aimdweight, 1f, Time.deltaTime * smooth);
    11.          
    12.         } else if(Aiming ==false & Reloading==false){
    13.             lefthandweight=Mathf.Lerp (lefthandweight, 1f, Time.deltaTime * smooth);
    14.        
    15.             righthandweight=Mathf.Lerp (righthandweight, 1f, Time.deltaTime * smooth);
    16.          
    17.             aimdweight=Mathf.Lerp (aimdweight, 0f, Time.deltaTime * smooth);
    18.        
    19.            
    20.         }
    21.         if (Reloading) {
    22.             lefthandweight=Mathf.Lerp (lefthandweight, 0f, Time.deltaTime * smooth);
    23.          
    24.             righthandweight=Mathf.Lerp (righthandweight, 0f, Time.deltaTime * smooth);
    25.            
    26.             aimdweight=Mathf.Lerp (aimdweight, 0f, Time.deltaTime * smooth);
    27.            
    28.            
    29.         }
    30.  
    31.  
    32.  
    33.        
    34.         //aIM IK
    35.         aimIk.solver.IKPositionWeight=aimdweight;
    36.         aimIk.solver.Update();
    37.  
    38.  
    39.  
    40.         //LEFTHAND IK
    41.         RaycastHit hit;
    42.  
    43.  
    44.         if (Physics.Raycast (leftHandCheckOrigin.position, leftHandCheckOrigin.forward, out hit, distance, layers)) {
    45.             if (hit.collider.CompareTag ("Door"))
    46.                 finalPos = hit.point;
    47.             else {
    48.                 finalPos = lhgrip.position;
    49.             }
    50.         } else {
    51.  
    52.             finalPos = lhgrip.position;
    53.         }
    54.         lefthand.solver.IKPosition = finalPos;
    55.         lefthand.solver.IKPositionWeight=lefthandweight;
    56.         lefthand.solver.Update ();
    57.  
    58.         //RIGHT HAND IK
    59.         Righthand.solver.IKPositionWeight=righthandweight;
    60.         Righthand.solver.Update ();
    61.  
    62.  
    63.  
    64.     }
    The issue is that the Aim ik doesn't reach the target. If i disable the right hand limb ik then the aiming works, but the gun is over the line of sight.

    Any idea?

    Thanks!
     
  14. Pithos

    Pithos

    Joined:
    Mar 31, 2015
    Posts:
    8
    A couple people have found the following useful:

    When using VRIK, it would be nice, when not using locomotion, to have the avatar move with the pelvis, rather than stretch like you're seeing. As such for my own local copy of VRIK, I've made the following change:

    In solve, as the else case of locomotion, in IKSolverVR.cs:

    Code (CSharp):
    1.             else
    2.             {
    3.                 Vector3 p = spine.pelvis.solverPosition;
    4.                 p.y = rootBone.solverPosition.y;
    5.                 rootBone.solverPosition = p;
    6.  
    7.                 Vector3 q = rootBone.solverRotation.eulerAngles;
    8.                 q.y = spine.pelvis.solverRotation.eulerAngles.y;
    9.                 rootBone.solverRotation.eulerAngles = q;
    10.             }
    I would love for something like this to become a standard part of VRIK. Give it a try, @sbmhome - assuming you have a pelvis tracker, I think it will do exactly what you're looking for.
     
  15. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey and thanks!
    Have you tried using the Bend Goals? BTW, there is a bug with the blending of Bend Goal Weight for the arms, that can be fixed with this patch. There are also Swivel Offsets that you can use.

    Hey,
    The problem is that LimbIK updates after AimIK so if the weapon is in the right hand, LimbIK will change it's pos/rot after AimIK has already aimed it. You'll need to change that update order or solve AimIK again after LimbIK.

    Hey,
    Thanks, I put it down to look into it. I think a problem with that particular code is just that it only works if the pelvis bone has the same orientation as the root, with it's Y axis pointing up.

    Cheers,
    Pärtel
     
    Danirey likes this.
  16. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    tapawafo likes this.
  17. anthony_ribot

    anthony_ribot

    Joined:
    Mar 5, 2015
    Posts:
    3
    Hi,
    I did try to solve my problem using swivel offset. It gives me the right bend orientation but I still have a limb rotation issue as you can see in this screenshot :


    So I'm still thinking that I must set the bend constraints by myself, the same way I did for FullBodyBipedIK. I need to be able to set these constraints by script, not by bending skeleton's limbs at starting.
    That's why I require your help ^^
     
    Last edited: May 4, 2017
  18. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    Inter Action system is really usefull. I.m using it to draw gun but There is a problem i have. I need to draw gun fast. I pause interaction and then move the gun so hand follow gun but Interaction system isn't fast enough to track gun. It reaches the gun with delay.
     
  19. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    VRIK's leg solver just works differently. Did your knees end up inverted without using bend goals and swiverl offset? Try rotating the knee bones in the Editor so the knees are bent slightly in their natural bending direction.

    Also, you can always just adjust the rotation of each bone in LateUpdate:
    Code (CSharp):
    1. void LateUpdate() {
    2. thigh.localRotation = Quaternion.AngleAxis(thighTwistAdjustment, thighTwistAxis) * thigh.localRotation;
    3. }
    Hey,
    If Position Weight is 1, it should always stay perfectly locked to the InteractionObject. Perhaps the Position Weight curve is just too slow, reaching the weight of 1 too late? Did you try adjusting the time values of that curve?

    Cheers,
    Pärtel
     
  20. manuel_rochon

    manuel_rochon

    Joined:
    Nov 9, 2015
    Posts:
    23
    Hi Partel,
    I think there has already been a couple of discussions about using the new Vive trackers for Pelvis and feet.

    So my question is about getting good automatic elbows behavior without additional trackers.
    I'm sure you are familiar with Ikinema's new project Orion:



    Their solver is pretty good, and it seems to give nice results for body parts like elbows, knees, shoulders.
    Is there any way with FBBIK or VRIK to get results that are similar especially for elbows.
    I've never been able to, and have spent lots of time trying to make a posed based system that tries to give a better elbow behavior based on the hands position and orientation.

    If there is currently no way to achieve this, are you planning to try to do it in the future?
    (maybe it's already there in newer versions, I'm still on 1.5)

    Thanks!

    Manuel
     
  21. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    Thanks for the code. I currently don't have a pelvis tracker and I'm not sure if I will support it in my game.

    I made a temporary solution that keeps the keep underneath the headset, while the character is in motion.
     
  22. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    I made a quick test with the trackers last week (when I managed to borrow some for a couple of days, they seem to be not selling to my region at this time). I'll explore this field more, when I manage to get my own trackers.
    Anyway, about the elbows, have you tried using Bend Goals and Swivel Offset? I'll be improving that stuff over the next versions anyhow..

    Cheers,
    Pärtel
     
  23. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    @Partel-Lang Hi, this might be the easiest question asked ;)

    How do I make a swinging rope? So when moving the top the bottom swings around with a rigid body on the last rope Transform.

    Do I use CCD IK? Any tutorials?

    Thanks.
     
  24. manuel_rochon

    manuel_rochon

    Joined:
    Nov 9, 2015
    Posts:
    23
    Hi Partel,
    I played a bit with them, I'll try them some more...
    But to use bend goal, you need a Target right? I'm hoping to find a solution where elbows work well without targets, having good automatic behavior for them.
    The elbows in your quick test seem to be ok, maybe I'm doing something wrong...
    I found out through testing that the elbows behave differently depending on what is the initial rest pose of your character.
    Like between having the character in T-Stance vs. A-Stance vs. arms on the side.
    Do you have any recommendations on that, or on what settings to use for bend goal or swivel offset?

    Thanks!

    Manuel
     
  25. manuel_rochon

    manuel_rochon

    Joined:
    Nov 9, 2015
    Posts:
    23
    It would also be good to have an option to have the knees stay parrallel to the foot, at least to a certain percentage..., right now knee and foot seem completely independant, which makes the leg go in impossible rotations.

    thanks!

    Manuel
     
  26. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Just make a chain of rigidbodies, link them with Joints like a ragdoll. I think you'll get better results with physics than with IK.

    Hey,
    You don't need a tracked target, just create an empty gameobject, parent it to the hand controller and move it in the direction you wish to bend the elbows toward. Assign is as the Bend Goal and set Bend Goal Weight to whatever feels right for you.

    You can do that same thing if you parent a bend goal to the foot tracker and move it forward so the knee will alyways be bent relative to the foot tracker.

    Best,
    Pärtel
     
    Griffo likes this.
  27. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    Hi Pärtel, how to use grounder with VRIK? As soon as I move on stairs for example, legs loses all ideas about ground.
    Second question, do you have any example how to use standard locomotion with VRIK?
    Thanks in advance!
     
  28. mrpinebox

    mrpinebox

    Joined:
    Jul 19, 2015
    Posts:
    1
    Hi @Partel-Lang

    I saw someone else had this problem in VRIK, but didn't see a resolution and it's occurring quite a bit with my Vive project. Most the time it seems to happen if I pause (or hit the system menu button on the controller). However, it might have also happened a few times when starting up. I've been running mostly in the editor on 5.4.4f1. Let me know if you need more information to track this down.

    Thanks!

    CompareApproximately (det, 1.0F, .005f)
    UnityEngine.Quaternion:FromToRotation(Vector3, Vector3)
    RootMotion.FinalIK.Leg:ApplyOffsets() (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVRLeg.cs:176)
    RootMotion.FinalIK.IKSolverVR:Solve() (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVR.cs:380)
    RootMotion.FinalIK.IKSolverVR:OnUpdate() (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVR.cs:266)
    RootMotion.FinalIK.IKSolver:Update() (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolver.cs:61)
    RootMotion.FinalIK.IK:UpdateSolver() (at Assets/Plugins/RootMotion/FinalIK/IK Components/IK.cs:27)
    RootMotion.SolverManager:LateUpdate() (at Assets/Plugins/RootMotion/Shared Scripts/SolverManager.cs:113)

    fRoot >= Vector3f::epsilon
    UnityEngine.Quaternion:FromToRotation(Vector3, Vector3)
    RootMotion.FinalIK.Leg:ApplyOffsets() (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVRLeg.cs:176)
    RootMotion.FinalIK.IKSolverVR:Solve() (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVR.cs:380)
    RootMotion.FinalIK.IKSolverVR:OnUpdate() (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVR.cs:266)
    RootMotion.FinalIK.IKSolver:Update() (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolver.cs:61)
    RootMotion.FinalIK.IK:UpdateSolver() (at Assets/Plugins/RootMotion/FinalIK/IK Components/IK.cs:27)
    RootMotion.SolverManager:LateUpdate() (at Assets/Plugins/RootMotion/Shared Scripts/SolverManager.cs:113)

    Look rotation viewing vector is zero
    UnityEngine.Quaternion:LookRotation(Vector3, Vector3)
    RootMotion.FinalIK.VirtualBone:GetDirectionToBendPoint(Vector3, Single, Vector3, Single, Single) (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVRUtilities.cs:171)
    RootMotion.FinalIK.VirtualBone:SolveTrigonometric(VirtualBone[], Int32, Int32, Int32, Vector3, Vector3, Single) (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVRUtilities.cs:151)
    RootMotion.FinalIK.Leg:Solve() (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVRLeg.cs:223)
    RootMotion.FinalIK.IKSolverVR:Solve() (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVR.cs:396)
    RootMotion.FinalIK.IKSolverVR:OnUpdate() (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVR.cs:266)
    RootMotion.FinalIK.IKSolver:Update() (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolver.cs:61)
    RootMotion.FinalIK.IK:UpdateSolver() (at Assets/Plugins/RootMotion/FinalIK/IK Components/IK.cs:27)
    RootMotion.SolverManager:LateUpdate() (at Assets/Plugins/RootMotion/Shared Scripts/SolverManager.cs:113)

    ... lots more errors...
     
  29. manuel_rochon

    manuel_rochon

    Joined:
    Nov 9, 2015
    Posts:
    23
    Yeah, that old trick never works well. Might be ok for knees, but for elbows it can't really work unless you do a special custom constraint instead of parenting it to the hand.
    I really hope you will get those features in eventually.

    Thanks!

    Manuel
     
  30. manuel_rochon

    manuel_rochon

    Joined:
    Nov 9, 2015
    Posts:
    23
    Actually, the elbows in VR IK work fairly well by default. It's in FBBIK that I can't get good results...
     
  31. yhloon

    yhloon

    Joined:
    May 2, 2014
    Posts:
    3
    Hi, can I use interaction system together with CCDIK or FABRIK? instead of FBBIK

    something like a snake to bite something...
     
  32. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Please take a look at the "VRIK (Grounder)" demo scene, it has an example of VRIK set up with 2 LimbIK components and GrounderIK.

    Hey,
    Please update to the latest FIK (1.6.1), I think that problem has been fixed already, let me know if it doesn't help.

    Hi,
    No, it only works with FBBIK, sorry, it is deeply rooted to FBBIK's parameters.

    Hey,
    With FBBIK I usually just keep rotation weight at 0 and just rotate the hand bone after solving is done (using ik.solver.OnPostUpdate delegate).

    Best,
    Pärtel
     
  33. manuel_rochon

    manuel_rochon

    Joined:
    Nov 9, 2015
    Posts:
    23
    Yeah I do the same thing, but the elbows don't behave as well as in VRIK.
    I guess I'll keep working on my pose-based system to drive the elbow position from the hand position and orientation...

    I really wish we could get all the features or VRIK and FBBIK in a unified solver where we can choose which behavior we want for each part of the body!
    For example (reaching head or not, hand pull or not (witch functional pull sliders), good automatic elbow behavior like VRIK, automatic shoulders movement when arms go high or far with a slider to control this behaviors weight, etc...)

    Thanks!

    Manuel
     
  34. VR_Develop

    VR_Develop

    Joined:
    Feb 21, 2017
    Posts:
    1
    Hi,

    we are thinking about buying final ik for our project. But I do have some questions:
    1. As I saw it is possible to use final ik with leap motion orion, right?
    2. Can we only use the upper boy with final ik? We don't need anything more. Even only the arms would be enough as we only have the leap motion as an input.
    3. Is there something implemented which enables me to grasp objects? Meaning: do you have an interactionmodule or something like that which allows me do easily grasp with my fingers?
    4. Do you plan to support Manus VR in the future?
    5. Do you support Xsens MVN?

    Best
    Andi
     
  35. manuel_rochon

    manuel_rochon

    Joined:
    Nov 9, 2015
    Posts:
    23
    Hey Partel,
    I have the same problem with particles, and I tried calling ik.solver.Update() in Update, but it doesn't work, I get this error:

    Initiating IKSolver with null root Transform.
    UnityEngine.Debug:LogError(Object)
    RootMotion.FinalIK.IKSolver:Initiate(Transform) (at Assets/SamsaraCommon/Plugins/RootMotion/FinalIK/IK Solvers/IKSolver.cs:33)
    RootMotion.FinalIK.IKSolver:Update() (at Assets/SamsaraCommon/Plugins/RootMotion/FinalIK/IK Solvers/IKSolver.cs:58)
    PlayerIncarnation:Update() (at Assets/SamsaraCommon/Scripts/Animation/PlayerIncarnation.cs:888)

    There is a root transform in the VRIK component.
    I guess it's because the component is disabled?
    Do I have to do anything else to make your trick work?
     
  36. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    They are actually totally different solvers internally, they work on completely different ways, so I don't think it would be possible to combine them. There is no such thing as a perfect IK algorithm that would be good for all purposes, each has it's own ups and downs.

    Hey,
    1. Yes, there is an integration package in Plugins/RootMotion/FinalIK/_Integration
    2. Not yet, planning to add that to VRIK though, in the meanwhile, virtual hierarchy of fake legs can be used.
    3. There's no automatic tool for that, the Interaction System requires you to create a pose for the hand on each object or just use hand animation.
    4. On the finger level, I believe it is easier and more efficient to use FK rather than IK.
    5. What exactly did you mean by supporting that? it's a motion capture tool, IK can be used as a layer on top of that to make corrections on the animation.

    Hey, it is amazing this bug hasn't come out in more than 3 years of FIK on the Store. :)
    Please use Start to disable the component instead of Awake while I figure this out.

    Code (CSharp):
    1. public VRIK ik;
    2.  
    3.     // Use this for initialization
    4.     void Start () {
    5.         ik.enabled = false;
    6.     }
    7.    
    8.     // Update is called once per frame
    9.     void Update () {
    10.         if (ik.solver.initiated) ik.solver.FixTransforms();
    11.         ik.solver.Update();
    12.     }
    Cheers,
    Pärtel
     
  37. scottlaforge

    scottlaforge

    Joined:
    Mar 12, 2013
    Posts:
    42
    Hi all,

    Hoping for some assistance. I'm trying to integrate the Leap Hands with VRIK. I used the Leap Motion integration demo that Partel provided as a starting point. This includes the VRIK Leap Motion script as seen in the photo here. I am also using the default Pilot model that had the VRIK script attached to it from the Virtual Reality demos.

    The arms of the pilot are successfully being manipulated by the wrist positions of the Leap Motion controller but the fingers are way distorted and out of control. Can anyone either explain to me how to modify the two sets of rotations (Hand Rotation and Finger Rotation), or tell me the correct way that the models fingers need to be set up in order to avoid the insanity. For Offset 1 and 2 of the Hands and Fingers, where are the pivot points on the model from which these offsets begin?

    Any help would be so very much appreciated.
    upload_2017-5-12_8-8-3.png
     
  38. manuel_rochon

    manuel_rochon

    Joined:
    Nov 9, 2015
    Posts:
    23
    Autodesk HIK permits all the features I was describing. And Ikinema also. So it's possible. ;)
     
  39. manuel_rochon

    manuel_rochon

    Joined:
    Nov 9, 2015
    Posts:
    23
    I still get the error with this code. I tried putting ik.solver.Update() under the "if", which stops the errors, but the particle system still does not work properly.
    The Character that has VRIK is instantiated by another script, could this be causing the issue?
     
  40. Scornz

    Scornz

    Joined:
    Jun 15, 2014
    Posts:
    27
    Hey!

    Just a very quick question about Grounder FBBIK... so let's suppose I have a mecanim sword 'stance' animation in which the front foot is firmly planted on the ground while the back foot is hovering around half a foot above the ground. I set up Grounder FFBIK (along with the regular FFBIK controller) and... it doesn't ground the back foot. The component is definitely working, as I checked with a stock idle animation, but it does not work with this 'stance' animation. I know there are other ways to fix this specific example, but the situation I'm currently in is a much more complicated problem, and solving this simple example would help me solve it.

    Thank you!
     
  41. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hi, I've made some adjustments to that VRIKLeapMotion script, to use forward and up axes instead of those weird rotation offsets. It's still quite confusing though and difficult to set up, so I'll make a demo for this asap.

    Hey,
    Yes, it is possible, didn't say it wasn't. It's just impossible to combine FBBIK and VRIK, that would require writing a brand new solver from scratch. Not saying it will not happen, I'm constantly working on improving the package, but not in the immediate future.

    Hey,
    Could you send me all the exact code you use for instantiating VRIK and updating it?

    Hey,
    That is just how the Grounder works. It considers 0 y in animation space to be the "animated ground" and if the real ground is higher/lower than character root y, it will offset the foot to compensate. So if the foot is floating in the animation, it will be floating by the same amount on terrain. Grounder doesn't plant feet, it warps the animation to match the ground. There is a diagram explaning it further on this page of the user manual. So the problem needs to be fixed on the animation side or you could add some ik.solver.leftFootEffector.positionOffset to the foot while that animation is played. Maybe add a "left/right foot height offset" curve to the animation clip in the Animation Import Settings.

    Best,
    Pärtel
     
  42. Scornz

    Scornz

    Joined:
    Jun 15, 2014
    Posts:
    27
    Hmmm, that's makes much more sense. Now, since I would only be using the effector to ground the back foot, do I have to put the Full Body IK component on the character? It seems like a huge component (along with lots of performance used) for something that will only be used for one state in the character's lifetime. Could I possibly add the component at runtime when it is needed, assign the necessary parameters, and then remove it again when it is not needed? Or maybe is there another component that will solely affect only one limb? Thank you!
     
  43. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    197
    Hey @Partel-Lang

    Is it possible to use FinalIK on a quadruped to make it look at the players hand in VR? I have a horse in a stable with several basic animations and I want to make it eat a carrot out of the players hand if it is close to its head. Is this achievable with FinalIK? What components would I need to get started?

    Cheers,
    Colton
     
  44. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    if you already have VRIK on the character, you should be able to use it's foot targets to adjust the feet.

    Hey,
    Yes, you could use AimIK on the spine, neck and head, then LimbIK after that to put the forelegs back to where they were since bending the spine would offset them. Make sure to run LimbIK after AimIK, just disable the components and call ik.solver.Update() in LateUpdate.

    Best,
    Pärtel
     
  45. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    @Partel-Lang

    Hi, how do I correctly blow a puppet up in the air using rb.AddExplosionForce () ?

    At the moment I'm just using - broadcaster.Hit(_unpin, _force, _pos); _pos is the puppets pelvis position, and that works fine for blowing the puppet straight up in the air, but I'd like to use - rb.AddExplosionForce (power, explosionPos, radius, 3.0); so the puppet is blow up in the air but also in the direction away from the explosion.

    So if I have a group of puppets and I drop an explosion in the middle of them they will all be blown around, away from the explosion.

    Thanks.
     
  46. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    G'day Pärtel,
    Awesome work with this plugin thanks!
    I'm just stuck on something and I I've looked through all the demos but couldn't find a solution.
    I am using the limbIK component to add an extra bit of motion to my character but I'd like to keep the foot animation and add the IK after that.

    This is my initial character pose -


    But with IK i loose the foot animation -



    Just wondering if theres a way to retain the underlying animation as well as having IK. I'm not fussed if the feet leave the ground.

    Any ideas?
    Thanks!
    Pete
     
  47. Deleted User

    Deleted User

    Guest

    So what exactly can I do with Final IK? Say I have basic animations (but high quality) for my character. Can I create new animations with this within Unity? Is this runtime only and if yes can I make new "animation" actions based on the ones I have. So for example using my walk animation for a human model and apply it to a fat zombie which would walk slower because it is more heavy than the human.
     
  48. Apeside

    Apeside

    Joined:
    Mar 12, 2017
    Posts:
    1
    Is it even possible to use VRIK for motion capture - just like Ikinema Orions solution? :)
    What is needed is to be able to record the motion capture and to be able to export it. Has anyone tried to motion capture with VRIK?
     
  49. contempt

    contempt

    Joined:
    Jul 31, 2012
    Posts:
    88
    If you just want the data record the tracker positions and use as targets and goals for VRIK to drive your characters.
     
  50. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    509
    I'm trying to create a smooking scene with final ik but There is a problem I can't solve.
    The cigarret is animated and hand inter action target is paused on it. The problem is that wrist get twisted when hand reach to mounth. I can't find a way to rotate forearm along with hand.