Search Unity

  1. Tune in to get all the latest Unity news live from Berlin on June 19, 6pm CEST. Set up a YouTube reminder!
    Dismiss Notice
  2. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  3. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

FINAL IK - Full Body IK, Aim, Look At, FABRIK, CCD IK... [1.0 RELEASED]

Discussion in 'Assets and Asset Store' started by Partel-Lang, Jan 15, 2014.

  1. jimthegrim

    jimthegrim

    Joined:
    Dec 18, 2015
    Posts:
    13
    Yes you can totally do this. I'm currently using VRIK as the top half of my character and Grounder on the bottom half.
     
    Partel-Lang and PyroStudios like this.
  2. trappist-1

    trappist-1

    Joined:
    Mar 26, 2017
    Posts:
    242
    VRIK already includes a locomotion feature similar to what I believe you are asking for.

    But more specifically, you can also use traditional mechanim walk/run animations with VRIK by tuning off locomotion (weight=0). Then the IK solves for head and hands while preserving the feet orientation as set by the animation.
    You may want to use Masks in your Mechanim layers so the walk animation affects only the lower body and not the arms or fingers.

    Cheers.
     
    Last edited: May 27, 2018
    Partel-Lang and PyroStudios like this.
  3. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,637
    Hey,
    Yes, if you set locomotion weight to 0, that will disable the built in procedural locomotion and you are free to animate the legs with Mecanim.
     
    PyroStudios likes this.
  4. crArtificialRome

    crArtificialRome

    Joined:
    May 4, 2018
    Posts:
    2
    Hi @Partel-Lang, first Final ik is awesome and i used it for a spider in VR. I can show more in one month i think or via pm or mail. I got a problem with the actual animal i am working on. It is a frog and i need to ground the feet and toes ... i tried to combine serveral grounder with limb ok for the toes but i had no luck. One method i got an offset on rotation and position and on one method i got a pelvis rotation that is off. I would like to use fik for the toes. Do you got a solution? It would be fantastic to be able to ground the feet together with toes.
     
    Last edited: May 30, 2018
  5. jimthegrim

    jimthegrim

    Joined:
    Dec 18, 2015
    Posts:
    13
    So I decided to use a dismemberment system for my game and it's created a bit of an issue for me where I now have to instantiate my VRiK character prefab separately from my HMD and controllers housing the targets. So I guess I just need to know how to re-reference the target fields with the VRiK script upon instantiation (respawn). Anyone know how I could properly do this?


    Woops! Never mind. Got it. ;)
     
    Last edited: May 31, 2018
  6. kerrmedia

    kerrmedia

    Joined:
    Nov 4, 2015
    Posts:
    242
    Hi Partel,
    Just need help starting this, added a terrain to my scene, want the spider that is moving by mesh nav to obey the height of the terrain that I added over the plane with the nav mesh backed paths.

    In the Grounder Bot demo, the Animation Controller shows in the Hierarchy list.

    I want to add Grounder to my spider, but the only animation controller I see is in the Inspector?

    bot_structure.PNG bot_structure.PNG spider_fik.PNG
     
  7. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,637
    Hey,
    So you need to ground each toe separately as the toes of a frog are quite large? Maybe using GrounderQuadruped to ground the feet, then after the IK has solved, run a raycast down from each toe tip and just rotate the toe bones then to point towards the hit point:
    Code (CSharp):
    1. // Set this script to the highest value in the Script Execution Order so it runs after the IK
    2. void LateUpdate() {
    3. // Do the raycast down from above the tip of the toe.
    4. // toe.rotation  = Quaternion.FromToRotation(toeTip.position - toe.position, hit.point - toe.position) * toe.rotation;
    5. }
    I've used this method before to ground the tails of alligators, but I can't find that code anymore.

    Hey,
    Sorry didn't understand the Animator Controller problem, the Grounder doesn't need to know anything about an Animator Controller. Just add GrounderIK and the IK components for the legs like the bot has in the Grounder demo.

    Cheers,
    Pärtel
     
  8. igoraleftinovich

    igoraleftinovich

    Joined:
    Feb 11, 2017
    Posts:
    4
    Hi Partel,
    I have problem with AimIK component. It works nice when the character is on horizontal surface but incorrect on a slopes. When I move down AimIK after Grounder in the script execution order it is starting to work. But this change resets after restart game. What is the right way to solve this problem?
    Thanks!
    View attachment 281072 View attachment 281071
     

    Attached Files:

  9. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,637
    Hey,
    Add the IKExecutionOrder component and use it to make AimIK update after the IK component that you use for the Grounder.
     
  10. igoraleftinovich

    igoraleftinovich

    Joined:
    Feb 11, 2017
    Posts:
    4
    That works! Thank you a lot!
     
  11. crArtificialRome

    crArtificialRome

    Joined:
    May 4, 2018
    Posts:
    2
    Thanks a lot this helped me. I am not a coder mainly an artist and the only "coding" i did was blueprint scripting in ue4. I was not thinking about the execution order. And the FromtoRotation was a fantastic hint! First i did a raycast and then moved the joint. That was causing stretched toes. My solution: I created empty Gameobjects at the tip position but as child of the hand ... they are casting a ray to -1 of the up from the root. Then i set the targetRotation with FromToRotation and use RotateTowards to rotate the actual transform.rotation of the joint. On end i RotateTowards the stored loacalRotation (void Start) of the joint.
     
    Partel-Lang likes this.
  12. kerrmedia

    kerrmedia

    Joined:
    Nov 4, 2015
    Posts:
    242
    Hi Partel,
    I start with Navmesh driven direction, and walking animations on a plane.
    I want to add FinalIK and use a terrain.
    Now I add a terrain, and add Grounder, but the spider does not stay on the terrain. I stays on the plane and submerges beneath the terrain. The plane the nav mesh is still under the terrain, could that be a problem?
     
  13. kerrmedia

    kerrmedia

    Joined:
    Nov 4, 2015
    Posts:
    242
    Could you look at my scene? this is what I'm seeing.
    pic_1.PNG
     
  14. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,637
    Hey,
    Is the layer of the terrain included in the Grounder's "Layers"?
    Is the character controller collider colliding with the terrain layer?
     
  15. kerrmedia

    kerrmedia

    Joined:
    Nov 4, 2015
    Posts:
    242

    Finally figured out what I was doing wrong. I still need to learn a lot of basic Unity3d fundamentals.
    Just noticed in the demos that the GrounderIK is added to an emptyGame object which is a child of the parent object (which is probably just a convenience, as the objects under Grounders control are added as properties of the class?)
    Anyway, works good now. I also did not realize that I could add navmesh to my terrain, like I said, I have a lot to learn.
    Just wondering, is there a basic terrain following going on with Navmesh on a bumpy terrain?
    With GrounderIK added, now the feet and legs step up on crates and boxes, even if they are not part of the terrain or Navmesh, which is really neat.
    Thank you for your patience.
     
  16. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,637
    Hey,
    Yeah, I think the NavMeshAgent follows the terrain on it's own, if I remember correctly.
     
  17. ColtonK_VitruviusVR

    ColtonK_VitruviusVR

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

    Just getting back into using VRIK and it seems to have many more features than 8 months ago when I stopped using it :) I'm wondering if it is possible to add an additional control to the spine solver. I would like this separate control to control how much the pitch of the players head in real life controls the pitch of the avatars head. What I mean by this is currently when I have the headset on and I look up/down the characters head moves up and down (starts bending legs or tip toeing), however I would like the avatars head to bend at the neck/head (only for pitching as I am assuming the player will never bend over at the hips or somehow perform a limbo style movement). Is something like this possible or are there other issues with this that I am not thinking about?

    Again, great job on the upgrades!
    Cheers,
    Colton
     
  18. Kitkwato

    Kitkwato

    Joined:
    Jan 18, 2017
    Posts:
    3
    Hi Partel, thanks for your asset, it's awesome!

    We're currently working on a VR multiplayer game and we're using VRIK for avatars (not first person view). Everything is working fine with the FinalIK dummies models and pilot for example, but the problem is for our custom models, we can't seem to get it right, always have weird rotations on torso hands and head. I'm using the same set up for all models, we tried different rigging with no success. I thought the issue could have been because of the head target and hand targets (or their transforms) since those anchors are shared across different avatars and attached to the HMD and controllers, but it's working fine with dummies and pilot, and it's even working with some orcs assets from the Unity Store.
    I'm now kinda stuck and don't know what to try next.
    Does the rigging needs to have a specific setup? I'm not a rigging specialist nor IK expert, so i'm struggling to understand what's the issue here. Since it's working perfectly with some models and not with other it's quite tough to debug.
    Any ideas?
    Thanks!!

    As a reference in the model screenshot i have the 2 vr controllers in front of me in a "driving" position
    rotations issues.PNG IK.PNG IK2.PNG
    rig.PNG playercharactersetup.PNG
     
  19. trappist-1

    trappist-1

    Joined:
    Mar 26, 2017
    Posts:
    242

    I wonder what happens if you were to make copies (placed in the scene and not parented to controllers) of the character's head, hand.R and hand.L bones and then set those as the targets for VRIK. If the character is still twisting when VRIK initializes then maybe it's something to do with the animator/animations?

    What does the character look like without the VRIK component (and also when VRIK's weight is set to zero)???
     
  20. rotsin

    rotsin

    Joined:
    Feb 22, 2013
    Posts:
    4
    Hi Partel,

    I'll apologize in advance if this has been discussed here before but do you have plans to convert some of the heavy duty routines in finalIK to use the newly release c# job system?

    Thanks and great work on the asset!
     
  21. Weendie-Games

    Weendie-Games

    Joined:
    Feb 17, 2015
    Posts:
    43
    Hi @Partel-Lang

    I'm trying to use the AimIK with UFPS (In the third person perspective) and i followed your video tutorial + the third person shooter example scene, but i can't get this working properly.

    Is there a way to set my aimIK Target to the center of the screen? (where is the crosshair)
     
  22. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,637
    Hey,
    Have you tried reducing "Neck Stiffness" and "Body Rot Stiffness"?

    Hey,
    All Final IK components work so that they'll match positions and rotations of the bones to the targets. That means if you use another character, you'll have to reorient the targets too (adjust their localRotations).

    Hey,
    In it's current state, the Animation Jobs can be used to make a very nice high speed IK solver, but that solver can't really be used for much as a Job can't have any reference types in it and it can't do stuff like raycasting as that's for the main thread only. So things like the Grounder and some more advanced IK techniques can't currently be done with them. But I've been exchanging emails with Unity devs about the Animation Jobs for some time now and we're working together to make this as good and useful as possible, not only for the IK but for other stuff too like physics. So if they manage to work out some of those limitations, I'll be sure to create Job versions of my solvers.
    In the meanwhile, Final IK will continue to work 100% in Unity 2018 versions.

    Hey,
    Code (CSharp):
    1. aimIK.solver.IKPosition = camera.transform.position + camera.transform.forward * 10f;
     
    Weendie-Games likes this.
  23. Kitkwato

    Kitkwato

    Joined:
    Jan 18, 2017
    Posts:
    3
    Thanks for helping. So we actually fixed it using custom target rotations for each avatars. It was the first thing i checked when trying to fix this TT' and since it was working fine for some models without adjusting targets (i still don't know how it's possible) i was looking somewhere else. But it's fixed! :D Capture (2).PNG
     
  24. Kitkwato

    Kitkwato

    Joined:
    Jan 18, 2017
    Posts:
    3
    Thanks for the answer! Setting custom rotations for each avatars works fine. It's crazy i was running in circles and localrotations was the first thing i checked when debugging TT'. Thanks again!!
     
  25. ColtonK_VitruviusVR

    ColtonK_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    123
    Thanks for the reply @Partel-Lang, yes I had previously tried that. The solution I ended up going with was to offset the head along the up axis based on the pitch of the players head. This keeps the avatars feet grounded and knees unbent while the player looks up and down.

    Cheers,
    Colton
     
  26. minad2017

    minad2017

    Joined:
    Dec 1, 2016
    Posts:
    8
    I am mainly using Look-at IK with Final IK.
    I have a question, is it possible to replace the bone object of Spine and Eyes while the game is running?
    I succeeded in replacing the head bone, but I could not find a method to replace the other bones.
    Is there a way?
     
  27. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    131
    Urgent!!:

    Using Unity 2018.1.4

    When i import it i get the following compiler errors:

    Code (CSharp):
    1. UNetWeaver error: Exception :System.IO.IOException: Sharing violation on path Temp\Assembly-CSharp.pdb
    2.   at System.IO.File.Delete (System.String path) [0x00073] in <e1a80661d61443feb3dbdaac88eeb776>:0
    3.   at Unity.UNetWeaver.Weaver.Weave (System.String assName, System.Collections.Generic.IEnumerable`1[T] dependencies, Mono.Cecil.IAssemblyResolver assemblyResolver, System.String unityEngineDLLPath, System.String unityUNetDLLPath, System.String outputDir) [0x002cf] in C:\buildslave\unity\build\Extensions\Networking\Weaver\UNetWeaver.cs:1862
    4.   at Unity.UNetWeaver.Weaver.WeaveAssemblies (System.Collections.Generic.IEnumerable`1[T] assemblies, System.Collections.Generic.IEnumerable`1[T] dependencies, Mono.Cecil.IAssemblyResolver assemblyResolver, System.String outputDir, System.String unityEngineDLLPath, System.String unityUNetDLLPath) [0x0004c] in C:\buildslave\unity\build\Extensions\Networking\Weaver\UNetWeaver.cs:1888
    5. UnityEngine.Debug:LogError(Object)
    6. Unity.UNetWeaver.Log:Error(String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:20)
    7. Unity.UNetWeaver.Weaver:WeaveAssemblies(IEnumerable`1, IEnumerable`1, IAssemblyResolver, String, String, String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1896)
    8. Unity.UNetWeaver.Program:Process(String, String, String, String[], String[], IAssemblyResolver, Action`1, Action`1) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:34)
    9. UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:TickCompilationPipeline(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget)
    10.  
    And


    Code (CSharp):
    1. Failure generating network code.
    2. UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:TickCompilationPipeline(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget)
    3.  

    Can you help??
     
  28. jimthegrim

    jimthegrim

    Joined:
    Dec 18, 2015
    Posts:
    13
    This looks to me a bit more like a Unet issue than a Final IK one. Not terribly sure though as I've not seen this particular error before (nor do I use Unet), but after Googling the error I found found several different sources discussing:

    error: Exception :System.IO.IOException: Sharing violation

    You might give that a try. :)
     
    Partel-Lang likes this.
  29. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,637
    Hey,
    Please try using ik.solver.SetChain().

    That is a Unity bug, not related to Final IK specifically, FIK doesn't even have any networking code in it. Looks like there are solutions or at least things to try to be found when you google it.

    Cheers,
    Pärtel