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,554
    Hey,
    I haven't used/don't have Slate so I really can't help with that at the moment as I have to go away for a week tomorrow. If you could send me a repro or something, I can take a look at it when I get back.

    Best,
    Pärtel
     
  2. lerpenbe

    lerpenbe

    Joined:
    Apr 27, 2018
    Posts:
    4
    Hey Pärtel,

    I'm trying to achieve something like this:

    VRIK with 3 extra trackers (feet and body) works fine, but now I'm struggling to extend the system to more trackers. At first I tried just setting the extra trackers as bend goals. That didn't work and I think I haven't really understood bend goals.
    I have up to 12 track points (with controllers + hmd) available but would already be really happy with the setup you can see in the video. The creator says in the comments he had to extend VRIK and I'm assuming he is talking about FinalIK. Do you have any pointers where I might start?

    Thanks a lot in advance
     
  3. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    Hello,
    Great asset, been quite fun to use!

    Quick bug report with the grounder feet placement module:
    It seems the grounder module likes to place feet on trigger colliders. I assume this is not intentional. It makes it look like my character is floating above the ground in some cases.

    In GroundingLeg.cs:
    Code (CSharp):
    1. // Get simple Raycast from the heel
    2. private RaycastHit GetRaycastHit(Vector3 offsetFromHeel) {
    3.     RaycastHit hit = new RaycastHit();
    4.     Vector3 origin = transform.position + offsetFromHeel;
    5.     hit.point = origin - up * grounding.maxStep * 2f;
    6.     hit.normal = up;
    7.     if (grounding.maxStep <= 0f) return hit;
    8.  
    9.     Physics.Raycast(origin + grounding.maxStep * up, -up, out hit, grounding.maxStep * 3, grounding.layers, QueryTriggerInteraction.Ignore);
    10.     return hit;
    11. }
    On Line 9, I inserted the last optional parameter "QueryTriggerInteraction.Ignore" to prevent the feet from stepping up onto a sphere trigger collider. This fixed the 'invisible step up' problem for me with 'Fastest' and 'Simple' modes. It did not fix it for 'Best' so obviously there are some other physics casts which are not ignoring triggers in there.

    Am I correct in assuming picking up triggers was not by design? Have I perhaps missed some obvious setting...?

    Again, great product, would definitely recommend.
    Cheers :)
     
  4. cocapasteque

    cocapasteque

    Joined:
    Sep 30, 2016
    Posts:
    20
    Hello @Partel-Lang,

    I really like your plugin and it's working like a charm for now !
    i'm using VRIK on my player character and everything is fine, but I would like to implement a hand grasp with hand animations with the vive controllers.
    I'm trying to use Interaction Targets but I'm really not sure it's the right way to go, do you have any advices on how I could achieve that ?

    Thank you very much !
     
  5. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    116
    Appreciate it! What’s the best email to contact you on?
     
  6. liekong1991

    liekong1991

    Joined:
    Nov 15, 2014
    Posts:
    12
    Hi guys!,I'm using VRIK and VRTK to make some multiplayer games with UNET, but I cant find some turtorials to sync them together, has anybody doing that before?
     
  7. Utopien

    Utopien

    Joined:
    Feb 15, 2016
    Posts:
    46
    hello ! iam doing a fly character i would like to use th grounder FBBIK but while close to landing my charater seams to be attractted by the ground and hole character is pull down to the floor also i fly he crouching weardly like he is some how late or not able to folw the position of the character thank for any help or any advenced tu toturail on grouder that cover that topic
     
  8. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,

    The bend goals are objects that the elbows/knees will be bent towards. The easiest to understand that concept would be to create an empty gameobject, assign as bend goal, set bend goal weight to 1 and move that object around in the scene view and see how it reacts. Bend goal object rotation is not used. If setting the extra trackers as bend goals did not work, try adding a child gameobject to the tracker transforms and using that instead. That would allow you to adjust the bend direction by moving the localPosition of the child gameobject.

    About that video, I have not been in contact with that developer (as far as I know) so I don't know how exactly they extended VRIK.

    Hey,
    Thanks! I was not aware of this issue, the Grounder was developed before the QueryTriggerInteraction was added to Unity I think. It doesn't fix it for the Best mode because the same fix needs to be applied also for GetCapsuleHit in GroundingLeg.cs and GetRootHit in Grounding.cs. Anyway, I will fix it for the next version too.

    Hey,
    The InteractionTarget is used by the InteractionSystem that does not support VRIK, it works with the FullBodyBipedIK only. I have just started working on an Interaction System for VRIK though, that would take care of this hand and finger placement on objects. It's not ready to be used yet though.
    But the trick would be to lerp the position of the hand IK target from it's default position relative to the controller to the position of the target hand pose on the object when the interaction starts. When it's over, you can lerp the localPosition of the IK target back to it's default value. The exact same thing needs to be done with the localRotations of the finger bones. Lerp them to match the target pose and lerp them back to default or animated values when the interaction stops.

    support@root-motion.com

    Hey,
    I haven't used VRTK much, sorry, but as far as syncing IK over the net, usually each client solves their own IK and all you need to worry about is syncing IK target positions and any parameters you adjust dynamically over the net.

    Hey,
    Attracking the character to the ground when it is close to it is essentially how the Grounder works. It is the "Max Step" value in the Grounder's solver. You can tween it close to 0 when it flies and back to it's normal value when it lands.

    I don't really understand the "crouching weirdly" issue you described, could you make a video please and send it to support@root-motion.com if you prefer to keep it private?

    Best,
    Pärtel
     
    Utopien likes this.
  9. Utopien

    Utopien

    Joined:
    Feb 15, 2016
    Posts:
    46
    Hey thank you for your reply and yes thank you again I will definitely send you the video if I don't find a solution this weekend

    about the grounder is there just way to pull just the feet but not the whole body so that only the legs ik would be attracted and not the whole body?
     
  10. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Yes, if you set "Lower Pelvis Weight" and "Lift Pelvis Weight" to 0, but then the feet won't reach when going down the stairs.
     
    Utopien likes this.
  11. spinaLcord

    spinaLcord

    Joined:
    May 25, 2015
    Posts:
    29
    Hello i hope someone can help me, how i can get the bone transform (in my case head) after using effectors? I got only the default world transforms without effectors.

    NodeHeadObj.transform.position dosen't return the real position after effectors. it's weird but the placment of the gizmo in my scene is correct.
     
  12. teighshiclbw

    teighshiclbw

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

    Is it possible to make AimIK or LookAtIK rotate bone on only one axis?

    I need character's upper body always look at target sphere, but only on X axis, not Y and Z.
    Character's spines can rotate left or rotate right, but not rotate up and rotate down.

    This is not what I want, spine rotate on X,Y,Z axes.


    I need something like this, spine rotate on only X axis.


    To do this, I need to add Rotation Limit Hinge to all spine bones
    Just curious, is it possible to produce similar result without adding Rotation Limit Hinge?
     
  13. RuslanM

    RuslanM

    Joined:
    Dec 2, 2016
    Posts:
    3
    Hi Partel! You have made great asset!
    We are developing VR multiplayer FPS with VRIK and we have an issue.
    Users have different height and the avatar does not look natural.
    User with big heigth: screen #1 1.jpg
    User with small heigth: screen #2
    2.jpg

    Have you any thouthts how to make all users head on the same altitude?
    All users head on the same altitude: screen #3
    3.jpg



    Another issue is when the user move fast, avatar's body starts to fly after the head.
    Is there any way to make moving more natural?
    You can see this issue on the video:
    https://www.dropbox.com/s/5srq5xtcog53oed/MPEG4w480f20h360AAC.mp4?dl=0
    Thanks a lot in advance!
     
    Last edited: Sep 27, 2018
  14. adhochero

    adhochero

    Joined:
    Feb 2, 2017
    Posts:
    43
    i have any issue with the vrik when i follow your tutorial and link everything up, when i hit play the hands a head are right but the feet are up by my head not on the ground where they should be. any ideas?
     
  15. MagicK47

    MagicK47

    Joined:
    Sep 5, 2017
    Posts:
    30
    hello
    My character sometimes gets stuck in the wall, gets stuck, wiggles and doesn't get out. How to fix it.
    2. Occasionally, the whole puppet will suddenly fly to a far place, with hundreds of thousands of coordinates. Because this time it received too much force, has been unable to move back directly, using the position of the function is also not
     
  16. jcbhmmn

    jcbhmmn

    Joined:
    Oct 4, 2014
    Posts:
    21
    FYI: Using the VRIK Leap Motion integration with latest Leap Core Assets, was getting this error
    Code (CSharp):
    1. Assets/FinalIK-LeapMotion/VRIKLeapMotion.cs(109,10): error CS0246: The type or namespace name `HandPool' could not be found. Are you missing an assembly reference?
    line 109:
    public HandPool handPool;
    should be changed to
    Code (CSharp):
    1. public HandModelManager handpool;
     
  17. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey guys, sorry for the delay once again, I was traveling to the States for Oculus Connect 5.

    Hey,
    You'll need to read the position of the head after the IK has done updating for the frame. You can do so from LateUpdate of a script that is set to a higher value in the Script Execution Order or by using the ik.solver.OnPostUpdate delegate.

    Hey,
    With AimIK you can use the RotationLimitHinge on the spine bones. You'll have to update the default local rotations of the limits in each LateUpdate though, so the limits would not intervene with the animation:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using RootMotion.FinalIK;
    4.  
    5. public class UpdateLimitRotations : MonoBehaviour {
    6.  
    7.     public RotationLimit[] limits;
    8.  
    9.     void Start()
    10.     {
    11.         limits = GetComponentsInChildren<RotationLimit>();
    12.     }
    13.  
    14.     void LateUpdate()
    15.     {
    16.         foreach (RotationLimit limit in limits)
    17.         {
    18.             limit.SetDefaultLocalRotation();
    19.         }
    20.     }
    21. }
    22.  
    Hey,

    You can calibrate the avatar height like this:
    Code (CSharp):
    1. float sizeF = (headTarget.position.y - ik.references.root.position.y) / (ik.references.head.position.y - ik.references.root.position.y);
    2.             ik.references.root.localScale *= sizeF;
    About the locomotion, that built in procedural locomotion was developed for a bit of leg shuffling in a couple of square meters space, so it doesn't work well with room-scale or thumbstick locomotion. I suggest you set locomotion weight to 0 and use a standard 4-8 directional strafing blend tree to make the avatar follow the horizontal direction towards the HMD with root motion and/or script. I've used Kubold's Movement and Rifle animsets from the Asset Store for those animations.

    Hey,
    Haven't seen that one before. What do you have for locomotion.weight? Do you have any animation playing on the character?

    Hey,
    1 is a general issue with ragdolls in Unity, they tend to get stuck in world geometry. You could make the wall colliders thicker, increase solver iteration count in PuppetMaster (that's just Rigidbody.solverIterations, not some PM calculation iterations). You could also try increasing rigidbody.solverVelocityIterations for the ragdoll rigidbodies if you are running a newer version of Unity.
    Also, making the character controller collider thicker and making sure it collides with the walls could help with preventing ragdolls getting stuck as they run past stuff.

    2. When does that happen? I mean does it happen when the puppets run into some walls or each other or just out of the blue?

    Hey,
    They keep updating their API so often and with significant refactors every time, that I just can't keep up. The latest working integration I had was for their version 4.3.4, but I hear it has some errors with their latest version again.
    My leap device has just broken down and stopped working too so I'm afraid I will drop making further itegrations to LeapMotion.

    Best,
    Pärtel
     
  18. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    So I just got back from Oculus Connect 5. We had a demo for the new Oculus Quest hardware and I'm happy to demonstrate 6 instances of VRIK working simultaneously on a mobile device with arena-scale locomotion. :D
     
    Kagyu and tapawafo like this.
  19. CloudyVR

    CloudyVR

    Joined:
    Mar 26, 2017
    Posts:
    715
    I am attempting to use a MakeHuman default skeleton. I also use hip tracking but I am noticing that VRIK is causing the stomach to bulge directly after being enabled (with hip tracker enabled):


    This is what the spine of the default MakeHuman rig looks like before I export to Unity:


    What I found is that if I straighten out the spine bones then VRIK works considerably well and looks natural without the bulging:

    This however affects the bone weighs and bend positions in Blender and I am trying to avoid that. So is it possible to use the default MakeHuman rig with VRIK and hip trackers without noticeable deformation?


    Here is the character .fbx from above example (using the default makehuman skeleton):
    https://drive.google.com/file/d/1q6FBsPtq1m56aaK1_M2qjQy6KP6yrmzC/view?usp=sharing

    Thank you for any advice
     
  20. MagicK47

    MagicK47

    Joined:
    Sep 5, 2017
    Posts:
    30
    2. Occasionally, the whole puppet will suddenly fly to a far place, with hundreds of thousands of coordinates. Because this time it received too much force, has been unable to move back directly, using the position of the function is also not

    This happens by chance when a puppet collides with other moving objects.The puppet's character controller is still in place, but the puppet's body and rigid body are flying far away, and the process of flying is not clear at all.It was an instant flight
     
  21. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Sent you a PM with a fix.

    Hey,
    Could be that problem 1 is the cause of problem 2 as well. If a part of the ragdoll like the hand of foot gets stuck, there will be huge forces trying to pull the joints together and if that hand or foot gets unstuck, those forces send the ragdoll flying.

    Also, what do you have for "Max Rigidbody Velocity" in BehaviourPuppet? It might help to reduce that value.
    Increasing "Pin Distance Falloff" in PuppetMaster could help too, as it reduces pinning forces the further the rigidbodies get from their targets.

    Best,
    Pärtel
     
  22. rob_vld

    rob_vld

    Joined:
    Jul 9, 2013
    Posts:
    191
    upload_2018-10-3_12-31-17.png

    @Partel-Lang

    (Free asset model Robot Kyle from the unity store)

    I am having difficulties setting up VRIK with this model, are the bones wrong?


    The hips and hands are out of bounds when using VRIK in combination with a leg animation

    https://i.imgur.com/7l8UpiC.gifv

    edit: I kind of solved the butt-issue by adding a pelvis target.... that looks decent!

    still having some issues with the arms, they seem to break when the length is too far
     
    Last edited: Oct 4, 2018
  23. ftejada

    ftejada

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

    I have a problem and I need your help.

    I am trying to get my character to touch the walls when doing to them while walking. I have looked at their example scene "Interaction Walls" and I have configured everything the same for my Character and walls, but sometimes the hands are still influenced by the Solver when they should not ... with more or less weight depending on the situation ....

    I've tried two different Character, Ethan from Unity and the Character from my game. With the same thing happens ...
    The problem happens in a random way and I have not known how to find a pattern of why it happens. It may work well for a while, but the problem usually ends up happening

    What am I doing wrong???? How can I solve that???

    I leave video for you to see the problem:



    regards
     
  24. Bamfax

    Bamfax

    Joined:
    Jun 12, 2016
    Posts:
    52
    Hi Pärtel,

    a quick question, would have a recommendation on how to have legs hanging freely using VRIK, only being set by animation? The use case is a character hanging somewhere e.g. on a pipe or cliff, or floating in space, where the legs just need to "hang" and possibly be animated. This collides a little bit with the default ground VRIK uses, when the player goes into crouch and its legs are solved to the VRIK ground.
    A solution would be to move vrik position further down with "plant feet" disabled. But I wanted to check with you if there are better ways.
    Many thanks again and kind regards,
    Olli
     
  25. CloudyVR

    CloudyVR

    Joined:
    Mar 26, 2017
    Posts:
    715
    With locomotion weight set to zero my testing shows the legs are fully influenced by the animation, I believe a "floating" lower body animation should still look semi-natural (even with vrik solving for hands, head and chest).

    However I may not be fully understanding your situation.

    Alternatively (or additionally) you could create "floating" feet (and or hip) targets for VRIK to track so as to maybe add the appearance of physics/momentum/inertia to the floating limbs...

    Also, I'm not completely certain (just my 2cents here) but this may be a job for PuppetMaster, Partel may have better suggestions.
     
    Last edited: Oct 3, 2018
    Partel-Lang likes this.
  26. Bamfax

    Bamfax

    Joined:
    Jun 12, 2016
    Posts:
    52
    Hi trappist, thank you for the answer. Having zero weight on locomotion and feet, there's also the effect that VRIK puts the feet on a virtual ground at local zero height (if I am not mistaken). So what happens is that my leg animation is playing fine as long as the person carrying the VR headset is standing, but when he bends down / kneels / crouches and the HMD comes down, the character feet hit the VRIK virtual ground at local zero height and are being solved to that ground (having "plant feet" off).
    Giving the head/hands targets now more room towards hitting local Y=0 could be a way, or setting targets for the feet below that, but that feels like there could be better ways, e.g. being able to turn the virtual ground off.
    Puppetmaster would be great for having realistic "free hanging" legs, but in this case I chose to not use it, since my character controller is not playing nice with it.
     
  27. JSwigartPlayful

    JSwigartPlayful

    Joined:
    Feb 29, 2016
    Posts:
    18
    Sorry if this has been asked already, but I have a question regarding script execution order. I notice that the IK scripts are hard coded to set themselves to a large script execution order, and I am curious why that is the case.

    Given that they appear to run their solver off of LateUpdate, I'm curious why they need such a high execution order. The late update guarantees they run after animation and such, Is there something that doesn't work with the IK stuff merely by running off the default execution order of LateUpdate ?

    I ask because I was going to move the execution order before the default so as not to require me to adjust the execution order of a bunch of other game scripts(like scripts that manipulate line renderers that need the IK transforms and such).
     
  28. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey, that is a bug that has been solved in the upcoming version, I'll contact you with a fix.

    Hey,
    Which version of Final IK are you using? You can check that from Plugins/RootMotion/FinalIK/Final IK ReadMe
    Asking because I thought I fixed that bug in the latest.

    Hey,
    Having leg weight at 0 and locomotion disabled, VRIK will try to maintain the feet where they are as animated (to enable animated locomotion) so moving the root down would do it and disabling plant feet. The next version of VRIK will enable you to run VRIK with no legs assigned too so it would not do anything at all with the leg bones.

    Hey,
    They are hardcoded to such high values to make sure they update after your own scripts that use LateUpdate. So the logic is this:

    1. Animator update
    2. Your LateUpdate scripts that maybe need to read the animated position of a bone and use that to set an IK target position
    3. IK updates in LateUpdate

    You can always disable an IK component and update it manually by ik.solver.Update();

    Cheers,
    Pärtel
     
  29. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @Partel-Lang
    I had version 1.6 ... I have updated and it seems that the problem has been resolved.

    Greetings and thanks
     
  30. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    254
    Hello

    I have a really weird error

    triggered a animation
    character.animator.SetTrigger("GetInVehicleR");

    and when finish de animation get this error

    Failed to call AnimationEvent StartInteraction of class InteractionSystem.
    The function must have either 0 or 1 parameters and the parameter can only be: string, float, int, enum, Object and AnimationEvent.
     
  31. RuslanM

    RuslanM

    Joined:
    Dec 2, 2016
    Posts:
    3
    Could you please write a little instruction how to use Movement animsets with VRIK? Because when I set weight Locomotion Weight = 0 and use Movement or Rifle animset, the model fly in the air. Look on screenshot.
     

    Attached Files:

  32. Bamfax

    Bamfax

    Joined:
    Jun 12, 2016
    Posts:
    52
    Hi Pärtel,
    many thanks for your reply again. I got my root down. And of course, it works finger licking good ;).
    If I may throw already the next question to you: Is it possible to use the locomotion procedural animation without the (XZ axis) position change to root? As I am already setting the root position from another script (also considering vive roomscale movement), the two are of course interfering with each other.
    Many thanks,
    Olli
     
  33. adhochero

    adhochero

    Joined:
    Feb 2, 2017
    Posts:
    43
    Partel-Lang, from following the "FINAL IK TUTORIAL - Full Body Biped IK - Linking Effectors to Objects" tutorial video. and i got the arms how i want. but is there a way to attach the head to an object. similar to how the hands are?

    to give some context I am using it for 3dof mobile vr. where the hands attached to a rifle, and the rifle it linked to the 3dof remote. but when i move the gun it pulls the player and the head moves allowing you to see parts of eyes and stuff from the inside. so i want to know if there is a way to attach the head to the camera so that it stays in place.

    thanks
     
  34. CloudyVR

    CloudyVR

    Joined:
    Mar 26, 2017
    Posts:
    715
    Occasionally I noticed something similar happening to some of my characters, in my case I just increased the near clipping plane for the main camera which helped make the effect less noticeable.
    There are probably better alternatives, especially if the head is pulling away from the camera by a lot.
     
  35. MagicK47

    MagicK47

    Joined:
    Sep 5, 2017
    Posts:
    30
    Is there a function that allows the puppet body to be temporarily free from physical effects and restored to its original state?In this way, I can reset the original state and change the position when the puppet is under great force.Otherwise, once the puppet has great power, it will fly to a far position. Because of the great power, it cannot move back. Even if it comes back, its limbs will be trembling
     
  36. spinaLcord

    spinaLcord

    Joined:
    May 25, 2015
    Posts:
    29
  37. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    Hello,

    I just bought FINALIK from asset store for use with VRTK + UMA + VRIK + 2 additional VIVE trackers for my feet.

    Is there any video or demo/tutorial on how to get all that working including the trackers?

    It looks so complicated, i dont even know where to start.

    Thanks
     
    Last edited: Oct 7, 2018
  38. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    I followed the steps from this link where it says VRIK at the bottom for use with UMA

    http://umawiki.secretanorak.com/3rd_party_integration

    using RootMotion.FinalIK;
    2
    3 vrik = go.AddComponent<VRIK>(); // Adding the component
    4 vrik.AutoDetectReferences();
    5
    6 vrik.solver.leftArm.shoulderRotationMode = IKSolverVR.Arm.ShoulderRotationMode.FromTo;
    7 vrik.solver.rightArm.shoulderRotationMode = IKSolverVR.Arm.ShoulderRotationMode.FromTo;


    and i get this thousands of these errors when i run it (crashes and shuts down Unity also) any ideas?

    NullReferenceException: Object reference not set to an instance of an object
    RootMotion.FinalIK.IKSolverVR+Arm.Stretching () (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVRArm.cs:220)
    RootMotion.FinalIK.IKSolverVR+Arm.Solve (Boolean isLeft) (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVRArm.cs:324)
    RootMotion.FinalIK.IKSolverVR.Solve () (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVR.cs:442)
    RootMotion.FinalIK.IKSolverVR.OnUpdate () (at Assets/Plugins/RootMotion/FinalIK/IK Solvers/IKSolverVR.cs:291)
    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)
     
    Last edited: Oct 7, 2018
  39. h00man

    h00man

    Joined:
    Apr 17, 2017
    Posts:
    54
    hello partel
    im trying to use aim ik and look ok to aim at empty gameobject for my shooter game.the problem is that when the target transform gets too close to my character and my charterer's gun he shows some jittering and wired behaviours on his hand.
    how do i tell the aim ik to stop look at the target if it gets too close
    thanks
     
  40. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Maybe the animation has an event named "StartInteraction". That would call StartInteraction of the InteractionSystem component if InteractionSystem is on the same gameobject as the Animator. So if there is an event like that on that animation, you might want to rename it.

    Hey,
    That problem happens because your root is very far away from the HMD so the IK tries to lean towards the targets. Having Locomotion weight at 1 used to move the root to the HMD, but with 0 it needs to be done manually. So if you spawn your character, make sure the root is where the HMD is, but on the ground level.

    Hey,
    You'd have to change IKSolverVR.cs a bit. Go to IKSolverVR::WriteTransforms at line 305 and change
    Code (CSharp):
    1. int i = 0;
    to
    Code (CSharp):
    1. int i = 1;
    to make it skip writing the first transform which is the root. If you still wish to keep VRIK's adjustments to root rotation, then don't make the change above, but in the same function change line 311 to
    Code (CSharp):
    1. if (i == 1) {
    FBBIK does not have a head effector by default. You can add one by using the FBBIKHeadEffector like in the "Head Effector" demo. But if you are working with VR, I really suggest you switch to using the VRIK component instead of FBBIK.

    Hey,
    Code (CSharp):
    1. foreach (Muscle m in puppetMaster.muscles)
    2.         {
    3.             m.MoveToTarget();
    4.             m.ClearVelocities();
    5.         }
    Hey, thanks for the purchase!
    It's a bug in the current version that has already been fixed for the next. Please go To IKSolverVRArm.cs and change line 96 to
    Code (CSharp):
    1. public AnimationCurve stretchCurve = new AnimationCurve();
    I'm sorry I don't have a tutorial for setting up VRIK with VRTK, UMA and additional trackers, haven't tried that specific combination myself either. The VRIKCalibrator should be helpful with setting up the trackers (see the "VRIK (Calibrator)" demo).

    Hey,
    You should try using the AimController component with AimIK. It helps with that ("Min Distance" parameter) and a bunch of other stuff related to AimIK that people usually struggle with. The next version will also have LookAtController for LookAtIK, but you can get it early from here.

    Best,
    Pärtel
     
  41. adhochero

    adhochero

    Joined:
    Feb 2, 2017
    Posts:
    43
    Pärtel said:
    FBBIK does not have a head effector by default. You can add one by using the FBBIKHeadEffector like in the "Head Effector" demo. But if you are working with VR, I really suggest you switch to using the VRIK component instead of FBBIK.


    the thing about that is i tried to use the VRIK first, by following you tutorial, but there were a lot of issues i was running into. yes the hands(which i don't want) and head were connected but for some reason the feet would act as if the ground was at eye level. and the payer would be a floating twisted mess. but using the Full Body Biped IK - Linking Effectors to Objects, it lets me keep the hands in positioned on the gun. all that i need to to attach the head to the center eye camera so that it overrides animations and stays centered. VRIK i see works good for 6dof vr but it wasn't necessary for 3dof, at least i couldn't figure out how to make it work right. but if there is a better way let me know. in the mean time ill try and work with the FBBIKHeadEffector.
    thanks for the response.
     
  42. igoraleftinovich

    igoraleftinovich

    Joined:
    Feb 11, 2017
    Posts:
    17
    Hellow Pärtel !

    I want to write two improvements for the full body ik. First is to write fbbik for the characters, that has four parts in the arms and legs chains instead of three in bipeds. And the second one is to write full body ik for an animal characters with four legs. The goal of this is to use affectors like in the fbbik with my non biped characters. Could you please give me some advice to do it in the right way?

    Thanks!
     
  43. DrEvil

    DrEvil

    Joined:
    Aug 11, 2012
    Posts:
    22
    I don't think that is the best approach. I'm running into a lot of issues where this late of an execution order is causing problems for built in unity systems. Particle systems attached to IK bones for instance, A.I. targeting systems that need those updated joint positions. It doesn't seem appropriate to have to reorder dozens of other systems to run after this late of an execution update, especially when some systems I have no control over(particle systems).

    The number of systems that one would need to execute before IK is much smaller than the number of systems that you have to force to run after it by hard coding it with such a late update, and that would lead me to think that since running after animation is handled merely by running in LateUpdate(animator runs during regular update), that IK could just run at default ordering and one could selectively run their targeting scripts at -1 or whatever, and not have to worry about the cascade effects of order dependency that arise from running IK later than everything else by default, some of which don't appear to be easily addressable by adjusting script execution order, since they involve built in systems(particlesystem and timeline being 2 examples).

    It looks like I'm going to need to reset these IK scripts to default execution order, but I wanted to explain the set of problems because I think they make for a compelling reason not to hard code them to run so late in the frame. I could work around the timeline being busted by manually ticking it in my own LateUpdate in manual mode, but Particle Systems don't have an execution order workaround that I can see, and after trying to compensate by ordering many AI scripts and 3rd party scripts around FinalIK, I think I've moved to the opinion that it is FinalIK doing the unreasonable thing here, for what it's worth.
     
  44. MagicK47

    MagicK47

    Joined:
    Sep 5, 2017
    Posts:
    30
    When I use the BLOCKING of the camera, when the character is too close to the wall, the camera will be blocked by the wall instead of close to the character. How can I solve this problem
    Cameras sometimes enter the walls
     

    Attached Files:

  45. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @Partel-Lang !!
    I have the following problem When my Character walks very close to a wall, the foot that crosses the wall detects that there is no floor behind, or this floor is at a lower height and makes the attempt to descend as if there were a step, slope or something like that .. .
    The Final IK version that I use is the last of the assets store that I downloaded 3 ~ 4 days ago

    Am I configuring something wrong? Is there any way to solve this without having to put a radius for the big collider capsule?
    I leave video:


    regards
     
  46. JSwigartPlayful

    JSwigartPlayful

    Joined:
    Feb 29, 2016
    Posts:
    18
    Separate question. Any reason why FixTransforms needs to run in separate update phases? Why can it not just do that at the top of the UpdateSolver? That way there wouldn't be any holes in the update cycle where transforms are bogus.
     
  47. adhochero

    adhochero

    Joined:
    Feb 2, 2017
    Posts:
    43
    i tried using the FBBIKHeadEffector. but it seams to cancel out the Full Body Biped IK - Linking Effectors to Objects that i had working before by following that tutorial you made.

    how do you attach the head with that without canceling out the hand links?
     
  48. Anticleric

    Anticleric

    Joined:
    Dec 15, 2013
    Posts:
    5
    Hey there,

    So, I'm doing something a bit unusual with VRIK. Basically I've set up a false mirror which has a character on the other side looking toward the player rigged with VRIK to mimic their movements. I'm doing this because it's mobile app and it's less costly than a render texture and and second camera. Also, the player rid is only mean to have arms.

    Anyhoo. Everything is working great except for the eyes. I use "Realistic Eye Movements" from the store, which does blinking, micro-saccades and various other nice tricks. The problem is, it seems to be fighting with VRIK and I'm not sure why. The eyes simply wont track the player camera while VRIK is running. If i turn VRIK off, it works fine.

    I then tried the Look At IK, but am having a similar issue. It doesn't seem to track one to one with the player's eye cameras. Sometimes they will update, sometimes they wont, and when I move closer to the "mirror" they look down at the floor. The blue guides seem to work properly.. but the eye bones seem to have a mind of their own.

    Ideally, I could get the Realistic Eye Movement scripts to take control of the eyes and eyelids and have VRIK worry about the body.

    Any help would be greatly appreciated.
    Cheers
    Blair
     
  49. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Not exactly sure whats going on with the head effector canceling out the hands there, but I made a demo for you of how it should be set up. If that doesn't help, please send me a repro project or something I could take a look at.

    Hey,
    FBBIK is a massive solver with thousands of lines of code so the task would be incredibly difficult. I mean if it was easy I would have done it myself already. Not even sure where to start giving you advice. You could start by getting rid of the FullBodyBipedIKInspector.cs so you could see the data structure of FBBIK in debug mode, just to get an understanding of how it's laid out.

    But if you are looking for IK for 4-bone animal legs, I suggest you try LegIK, it works pretty well with the Wolf in the package at least. You can also use FBBIK on animals, just skips a leg bone in each leg.

    Hey,
    About the particles, unfortunately there is no way to get any custom IK in between Animator update and ParticleSystem update (unless you disable the Animator and update it in Update and the directly IK after that) so not hardcoding into the Script Execution Order would not help with that at all. I've spoken about this to Unity devs, saying the particles are just a cosmetic effect and should be updated after LateUpdate, but they say it's like that mostly for historical reasons, it can't be changed without breaking a lot of peoples' games (which is also why I can't change my stuff at this point). Please see this answer about dealing with IK and particles. I'm also working on AnimationJob versions of my solvers, which would eliminate this issue, but it's gonna be a major rewrite, so it's gonna take time.

    I can't say if the number of systems that need the IK to run before/after LateUpdate is bigger or smaller, it really depends on each game. But what would be really bad is not knowing for sure whether the IK runs before or after your LateUpdate, which you would have if there was no hardcoding to extreme values.

    Btw, you can disable the execution order thing just by commenting out line 31 in IKInspector.cs. After that you can clear out the Sscript Ex. Order of the FIK components.
    Other options are disabling the IK component and calling ik.solver.Update() and/or using the ik.solver.OnPostUpdate delegate.

    Hey,
    The blocking code in CameraController.cs is just a few lines of code starting from line 54, so it's not really a complex thing (just a demo asset). It probably happens because the raycast from the target starts already from inside or other side of the wall so the wall gets ignored. So it must be the target position (smoothPosition + rotation * offset) being in the wall.

    Hey,
    The easiest solution would be just to extend the ground colliders past the walls a little bit.
    Other solutions require changes to the animator controller to make the character stand when blocked by a wall or using some complex IK to make the feet not penetrate the wall, but that requires some expensive sphere casting. I have added something like this to the next version of FIK, might be worth a try.

    Hey,
    FixTransforms moves all the bones to their default rotations (stored at Start) in Update, so it runs before Animator update. If it ran after that, you'd see no animation and if it ran after the IK, you'd only see the default pose.

    Hey,
    It's probably because the Realistic Eye Movement is updating before the IK. You could disable the IK component and call ik.solver.Update any time after Animator update (if you use any animation on that avatar) and before whevever REM updates.

    Best,
    Pärtel
     
  50. JSwigartPlayful

    JSwigartPlayful

    Joined:
    Feb 29, 2016
    Posts:
    18
    This option is only useful on bone chains that aren't animated, right? I mean, if there's animation on a bone, the animation update is going to stomp the 'fixed' default values.

    In my situation I'm running IK on an unanimated bone chain, and in order to get attached particles showing up correctly, I needed to disable FixTransforms(so at least the transforms are consistent throughout the update phases). However, the solver doesn't produce as nice of results with fix transforms disabled as it does with it enabled, because it has trouble solving from one end of the limits to the other, while it has no trouble from the default position which is in the middle of the limits.

    What I ended up doing to get the better solutions as well as the functioning particle systems is that I added another option next to the existing bool called fixTransformsPreUpdate, and all it does is call FixTransforms at the top of UpdateSolver(if enabled), so i get the benefits of the better results, without the spotty reliability of transforms throughout the rest of the frame. Might be a good addition to the API, though I understand that this option would not function properly on IK chains on animated bones.