Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. 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
  8. 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:
    269
    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,677
    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:
    246
    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,677
    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:
    6
    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,677
    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:
    6
    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:
    246
    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:
    246
    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,677
    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:
    246

    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,677
    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:
    124
    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:
    269

    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:
    47
    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,677
    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;
     
    neoshaman and Weendie-Games like 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:
    124
    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. AnAppGames

    AnAppGames

    Joined:
    Jan 3, 2017
    Posts:
    136
    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,677
    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
     
  30. errandfox

    errandfox

    Joined:
    Apr 22, 2015
    Posts:
    42
    HI Partel, I have a strange problem.
    I'm using FBBIK to put my model's left hand on his gun in the correct position, using FBIK.solver.leftHandEffector.position = Lefthandmarker.position; i have a few weapons that are swapped around in runtime, with unique left hand transforms.
    in late update on each weapon's ik script I pretty much do set position and position weight.
    Now the problem is, it only works when i do:
    FBIK.solver.leftHandEffector.target.position = Lefthandmarker.position
    FBIK.solver.leftHandEffector.position = Lefthandmarker.position.
    There is no target set, as I couldn't change the target in runtime, but somehow it works perfectly.
    I do get a flood of null reference exceptions relating to the 'target' as it's null.
    Why would this be happening? If I just do lefthandeffector.position = marker.position by itself it does nothing, the left hand doesn't follow the marker position.
    I must be missing something but I can't think what it would be. Maybe the tiny delay caused by the 999+ null references is doing something?
     
  31. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    If a target is assigned to the effector, all it actually does is overwriting leftHandEffector.position each time before it updates. If you have no target assigned, don't try to access effector.target.position, you'll get those nullreferenceexceptions.

    you can change the target in runtime by:
    Code (CSharp):
    1. ik.solver.leftHandEffector.target = newTargetTransform;
    Is the right hand moved by the IK too? If it is, that might explain why you are not seeing the left hand on the gun, as you set the effector.position before the IK solves, but during the solving process, the right hand moves/rotates and left hand effector position is not updated according to that.
     
  32. CharlesDeep

    CharlesDeep

    Joined:
    Feb 19, 2018
    Posts:
    1
    Hi,
    The job system is alredy avaiable. Although this is an excellent asset, it doesn't scale well in some games when a lot of characters have IK, as the IK solver takes about a millisecond for just one character. Any plans on using the Job system to make it multithreaded?
    Thanks.
     
    matteumayo likes this.
  33. errandfox

    errandfox

    Joined:
    Apr 22, 2015
    Posts:
    42
    Thanks Partel that did work. No more errors and its working. However I'm using the recoil script as well, and the left hand effector isn't getting any feedback from the recoil offset anymore, although it was before. Maybe because I'm updating the left hand target all the time; I will investigate some more, thankyou for your help!
     
  34. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    The AnimationJob system can be used to make a nice high speed solver, but at it's current state that solver's usefulness is still quite limited. For example you can't make ray casts from a Job as that needs to be done from the main thread. That means stuff like the Grounder can't use a Job based solver, because some raycasting needs to be done in between the controller and the IK jobs. But I'm in contact with the dev team about these limitations and we're trying to work them out and I've already started to make Job versions of my solvers. It will take a while though obviously...

    Hey,
    That is because the recoil works by using effector.positionOffset. If you have effector.positionWeight at 1, that will pin the hand to effector.position and overwrite the positionOffset. You could convert your left hand target code to use positionOffsets instead. So instead of
    Code (CSharp):
    1. ik.solver.leftHandEffector.position = target.position;
    you can write
    Code (CSharp):
    1. ik.solver.leftHandEffector.positionOffset += target.position - ik.solver.leftHandEffector.bone.position;
    Using += instead of = there because the solver resets effector positionOffsets to zero after each update, that allows for multiple simultaneous offset modifiers working together additively, which is what you need there.
     
    neoshaman, matteumayo and errandfox like this.
  35. errandfox

    errandfox

    Joined:
    Apr 22, 2015
    Posts:
    42

    Ah! Genius thankyou! I had a head scratch for a moment because using offsets, the recoil started working but the left hand positioning stopped; then I realised I am not using IK for the right hand at all, only for the recoil moments. So I've turned down the position weight during recoil, and turned it back on for normal left hand only ik. working perfectly thanks :)
     
  36. dave_vrc

    dave_vrc

    Joined:
    Apr 27, 2017
    Posts:
    2
    Hi Partel,
    In our game, we are using 6 point tracking, So we have targets for head, arms, hip, legs all mapped to 1.0 weights, including bend targets for the knees. Our player object hierarchy that looks like this:
    upload_2018-6-22_18-54-42.png

    The targets are updated in LateUpdate with positions and rotations from tracking data. The head_target rotation is used to decide the heading of player_root.

    The problem is that the legs are rotating along their main axis (in opposite direction) when the head rotates. The feet and hip are following tracking as expected, just the leg bones rotate. I don't see this behavior with the bend targets unweighted.
     
  37. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    Just sent you a PM about this.

    Best,
    Pärtel
     
  38. Mihailkostov

    Mihailkostov

    Joined:
    Feb 19, 2016
    Posts:
    4
    Hello Partel,

    Firstly, what an amazing asset! I am in absolute awe - you have done a fantastic job!

    I encountered an issue, however, while trying to create a full-body tracking scene using Vive with an HMD, 2 Controllers and 3 Trackers (2 on feet, 1 on hips). The issue arises when I try to bend my knees (raising a leg, squatting, etc). The knees doesn't seem to follow the orientation of the body and only bend in one direction. If I stay positioned forward and raise my leg it works fine (fine-ish, since without trackers on the knees they don't bend exactly as mine), however if i rotate my body and raise my legs, the knees stay in the initial orientation and can result in legs bending backwards or sideways. Here are some screenshots to help me explain the issue.

    Problem01.JPG
    Fine here, facing foward.

    Problem02.JPG
    Turing 90 degree.

    Problem03.JPG
    Turning 180 degree.

    Can you advise a way to fix this? I tried the demo of iKinema's Orion and it seems to track fairly accurately any bending in my knees, I must be doing something wrong in Unity for Final IK to behave like that. Any help will be really appreciated!

    All the best,
    Mihail
     
  39. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey and thanks!

    Might be something that has already been fixed as I rewrote the leg bending code for the next version. I'll PM you.

    Cheers,
    Pärtel
     
  40. Mikekan13

    Mikekan13

    Joined:
    May 30, 2015
    Posts:
    40


    I am using puppet master and final IK to try and make an organic tentacle. I have FABRIK and puppet master set up correctly but I am trying to make it so the tentacle is influenced by gravity but I can still control where the tip goes. If I set the puppet to dead then the gravity works but I can no longer influence the FABRIK target. I feel like it is an easy solution but can't figure out how to do it. Any help is greatly appreciated.
     
  41. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    Did you try setting pin weights to 0 for all the tail muscles in PuppetMaster's indivudual muscle settings?
    That would unpin the tail so it would try to follow the IK target physically by muscles and also be influenced by G.

    Best,
    Pärtel
     
  42. Kagyu

    Kagyu

    Joined:
    Mar 5, 2016
    Posts:
    43
    Hi Partel,
    I am adding Head Effector in runtime with the following code.
    If I remember correctly, the code worked fine with former version of FInalIK but now I get errors.
    Code (CSharp):
    1. private void SetUpHeadEffector(GameObject actor)
    2.     {
    3.  
    4.         // Instantiate, add FBBIK
    5.  
    6.         FullBodyBipedIK ik = actor.AddComponent<FullBodyBipedIK>();
    7.  
    8.  
    9.  
    10.         // Auto-detect biped references
    11.  
    12.         BipedReferences references = new BipedReferences();
    13.  
    14.         BipedReferences.AutoDetectReferences(ref references, ik.transform, BipedReferences.AutoDetectParams.Default);
    15.  
    16.         ik.SetReferences(references, null);
    17.  
    18.  
    19.         // Set some solver params you might want to use with head effector
    20.  
    21.         ik.solver.leftHandEffector.maintainRelativePositionWeight = 0.75f;
    22.  
    23.         ik.solver.rightHandEffector.maintainRelativePositionWeight = 0.75f;
    24.  
    25.  
    26.      
    27.         // Creating the head effector GameObject
    28.  
    29.         GameObject headEffectorGO = new GameObject();
    30.      
    31.         headEffectorGO.name = ik.gameObject.name + " Head Effector";
    32.  
    33.         headEffectorGO.transform.position = references.head.position;
    34.  
    35.         headEffectorGO.transform.rotation = references.head.rotation;
    36.  
    37.  
    38.  
    39.         // Adding the FBBIKHeadEffector script
    40.  
    41.         FBBIKHeadEffector headEffector = headEffectorGO.AddComponent<FBBIKHeadEffector>();
    42.  
    43.         headEffector.ik = ik;
    44.  
    45.  
    46.  
    47.         // Assigning bend bones (just realized I need to make a constructor for FBBIKHeadEffector.BendBone)
    48.  
    49.         FBBIKHeadEffector.BendBone spine = new FBBIKHeadEffector.BendBone();
    50.  
    51.         spine.transform = references.spine[0];
    52.  
    53.         spine.weight = 1f;
    54.  
    55.  
    56.  
    57.         FBBIKHeadEffector.BendBone chest = new FBBIKHeadEffector.BendBone();
    58.  
    59.         chest.transform = references.spine[1];
    60.  
    61.         chest.weight = 0.75f;
    62.  
    63.  
    64.  
    65.         headEffector.bendBones = new FBBIKHeadEffector.BendBone[2] {
    66.  
    67.                   spine,
    68.  
    69.                   chest
    70.  
    71.               };
    72.  
    73.  
    74.  
    75.         // Set weights
    76.  
    77.         headEffector.bendWeight = 1f;
    78.  
    79.         headEffector.positionWeight = 1f;
    80.  
    81.         headEffector.rotationWeight = 1f;
    82.  
    83.     }
    The error log says "NullReferenceException: Object reference not set to an instance of an object
    ActorImporter.SetUpHeadEffector (UnityEngine.GameObject actor) (at Assets/ActorImporter.cs:307)" and the line 307 which is the line 33 in above.
    Code (CSharp):
    1.   headEffectorGO.transform.position = references.head.position;
    I commented out the relevant lines then I confirmed that my model's reference filled properly...
    Do you have any advice?
     
  43. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    The left hand side of that line can't be wrong as you've just created the headEffectorGO, so it must be the right hand side - references.head.

    Could you please add
    Code (CSharp):
    1. Debug.Log(references.head);
    before that error line and see if it logs null?
    You might have seen the references filled out correctly because if you click on the FBBIK gameobject, the FBBIK editor fills in the references if it finds them empty.
    But the code that sets up the refs looks fine too so I'm really curious about this..
     
  44. chgeorgiadis

    chgeorgiadis

    Joined:
    Jan 30, 2018
    Posts:
    1
    Is FINAL IK time based? I mean, i want an Avatar to make specific moves with hands in specific timestamps (like reading a story)
     
  45. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,

    Final IK components on their are not. Each frame they read the pose, solve according to their targets and parameters and write the results back on the character. But you can always just animate an IK target with the Animation Window or set it up with the InteractionSystem.

    Best,
    Pärtel
     
  46. nocanwin

    nocanwin

    Joined:
    May 7, 2009
    Posts:
    134
    Never seen unity do this. Settings won't expand for some of the VRIK components. Reverences, Solver, Settings. Any ideas? I tried reimporting with no luck. They work in an empty project. I'm on 5.6.5p3

    [SOLVED] I have Google's analytics plugin and it also has a TooltipAttribute class so I just shoved the google classes in a google namespace and it's now working.
     

    Attached Files:

    Last edited: Jul 5, 2018
  47. Kagyu

    Kagyu

    Joined:
    Mar 5, 2016
    Posts:
    43
    Partel,

    As you guess, I got following log.

    Null
    UnityEngine.Debug:Log(Object)
    ActorImporter:SetUpHeadEffector(GameObject) (at Assets/ActorImporter.cs:307)
    ActorImporter:SetUpActor(GameObject) (at Assets/ActorImporter.cs:112)
    <GetAssetBundle>c__Iterator0:MoveNext() (at Assets/ActorImporter.cs:92)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

    It seems references are not filled when they are called...
     
  48. Mihailkostov

    Mihailkostov

    Joined:
    Feb 19, 2016
    Posts:
    4
    Hello again Partel!

    The knees are behaving so much better now! Thanks a lot for that! I have been struggling to get the chest in the right position as well. It keeps positioning it way forward than it should, obscuring the view in First Person to the rest of the body almost entirely - any clue why that might be? When I bend it seems to calculate it correctly as shown in the 4th image.
    Here are some images showcasing the problem as well as my VRIK settings in case I missed out on something. 01.jpg
    02.jpg
    03.jpg
    04.jpg
    05.jpg

    Thanks again for being so supportive of our struggles!

    All the best,
    Mihail
     
  49. Soulghai

    Soulghai

    Joined:
    Mar 24, 2016
    Posts:
    3
    Hello! Thank you, Partel! You did a good job!
    I have one little question) Where can I see any road map or something like this)?
    Or when we can see update for this great plugin?

    Thank you!
     
  50. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    1,677
    Hey,
    BipedReferences should give you a warning in the Console if it's not filled.
    Might be that the ik.transform you pass into AutoDetectReferences does not have an Animator component on it?
    Is it a Humanoid or Generic character?

    Hey,
    How are you moving the root transform? It might be good to move the root transform back a bit, so the IK would be pulling the spine from back to forward. Would the spine look better if you set pelvis weights to 0?

    Hey,
    There's no official public roadmap, but this is what has been added/fixed for the next version so far:

    Version 1.8

    Upgrade Guide

    1. MAKE A BACKUP! Open a new scene, delete “Plugins/RootMotion” and reimport. Also reimport PuppetMaster if you had that in your project.
    2. If you were using any of the integration packages, reimport them from “Plugins/RootMotion/FinalIK/_Integration”.

    Improvements

    1. Added scaleMlp to VRIKCalibrator.Settings to enable you to make adjustments to character scale.
    2. Added LookAtController.cs and “LookAt Controller” demo scene. LookAtController is a tool for LookAtIK that easily takes care of problems like smoothing weight, smooth switching between multiple targets, smooth turning towards the target and root rotation.
    3. Added an error log to VRIK that prevents it from updating when the character scale is zero and producing NaN errors.
    4. Demo character can double-jump now.
    5. VRIK leg solver does not sample the animation each frame to find the bend plane any more as it has proven to be unreliable. Instead you'll get a "Bend To Target Weight" for the legs. You can use it to keep the bending plane locked to the hips (value of 0) or to the rotation of the foot (value of 1) or anything in between.
    6. Added legLengthMlp to VRIK, enables you to configure default leg length.
    7. Added stretchCurve to VRIK’s legs for automatic and smooth stretching.
    8. Added “Aim Offset” to FPSAiming.cs, that enables you to adjust the normal aiming angle in the First Person Shooter demos.
    9. Added “Shoulder Twist Weight” to VRIK arm settings, the weight of twisting the shoulders back when arms are lifted up.
    10. Added a new offset modifier and demo for FBBIK - “Penetration Avoidance”, that can be used to keep the hands and feet from penetrating scene geometry when the character has a very slim character collider.
    11. Added a new component - ArmIK, which enables you to use VRIK’s arm solver independently.
    12. TwistRelaxer has public “Parent” and “Child” fields now, so it can be used on forearm roll bones that are not parents of the hand bone. Will be automatically assigned if left empty.
    13. Added VRIKPlatformController.cs and the “VRIK (Moving Platform Controller)” demo, that enables you to easily move your VRIK character from platform to platform.
    Fixes

    1. Fixed avatar height changing when recalibrating VRIK.
    2. Fixed a NullReferenceException in IKSolverVRArm.cs when VRIK was added in runtime.
    3. Changed Update to LateUpdate in VRIKPlatform.cs to support Mecanim-animated platforms.
    4. Added FingerRig.StoreDefaultLocalState() to update the default pose used by Fix Transforms.
    5. Made it possible to manually update HandPoser and GenericPoser by calling poser.UpdateManual();
    6. Fixed VRIK “Shoulder Weight” blending issue in “Yaw Pitch” mode.
    7. Fixed a bug in VRIK that moved the head off target when “Pelvis Position Weight” was between 0 and 1.
    8. Fixed a bug with calling FBBIK solver.SetLimbOrientations before FBBIK has initiated.
    9. Fixed a bug with unnatural VRIK spine bending when using laying down or other non-vertical animations.
    10. Fixed a bug with VRIKCalibrator scale when character root Y was not 0.
    11. Fixed physics interpolation issues caused by GrounderQuadruped’s and GrounderIK’s root rotation in Unity 2017.x versions.
    12. Fixed errors with VRIK used on shoulderless characters.
    13. Fixed InteractionSystem not working when FBBIK was updated manually.

    That's not all I've been working on of course, I have some bigger things in progress for Final IK, like a baking tool and recently also started creating C# Job versions of my solvers (experimental stuff).

    Cheers,
    Pärtel