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

    Celiken

    Joined:
    Jun 1, 2017
    Posts:
    5
    Hi Partel,

    We're using VRIK for controlling our avatar.
    However we want our game to be playable either with a full body-tracking (HMD + 2 controllers for hands + 3 trackers for pelvis/feets) or with basic set (HMD + 2 controllers for hands).
    We actually have no problem for the full body, the solver is working well.
    But when we remove the trackers and start moving around our scene, the avatar move and start walking but keep his legs stretched as if the avatar doesn't have knees. We tried playing with locomotions variables and make sure the position weight of pelvis/legs are to 0, but there's no change.

    Do you have any idea of where it could come?

    Thanks in advance, and good job for your asset.
     
    ROBYER1 likes this.
  2. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    Sorry, you'll also have to comment out
    Code (CSharp):
    1. if (!enabled) return;
    from private void OnPreFBBIK() and private void OnPostFBBIK() in InteractionSystem.cs lines 757 and 766.

    Hey,
    If you don't want VRIK to use any legs, you should remove the leg bones from VRIK's references (works only with the latest version). Moving the root to keep up with the HMD would be entirely up to you though, you can do it simply by lerping the root towards the position of the HMD horizontally:
    Code (CSharp):
    1. Vector3 desiredRootPos = new Vector3(ik.solver.spine.headTarget.position.x, ik.refereces.root.position.y, ik.solver.spine.headTarget.position.z);
    2. ik.references.root.position = Vector3.Lerp(ik.references.root.position, desiredRootPos, Time.deltaTime * rootSpeed);
     
  3. Celiken

    Celiken

    Joined:
    Jun 1, 2017
    Posts:
    5
    We actually want the legs to be animated depending on the HMD position. Can it be solve with VRIK, or do we need to use another solver for this specific case?
     
  4. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Oh, sorry, misunderstood you, keep the legs. You could use the built in locomotion (set weight to 1 in Locomotion settings on the bottom of VRIK) or use a strafing animation blend tree to move the root towards the horizontal position of the HMD with root motion and/or script.
     
  5. Celiken

    Celiken

    Joined:
    Jun 1, 2017
    Posts:
    5
    The locomotion weight was, somehow, set to 0.5, I tried setting it at 1. But it doesn't change many, the avatar is still walking but keeping his legs stretched and his feets planted on ground. Here is a video so you can see it better.
     
  6. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    Great!

    I actually had to comment out the following lines
    Code (CSharp):
    1. if (!fullBody.enabled) return;
    And now it works like a charm!
     
  7. asb9599

    asb9599

    Joined:
    Oct 22, 2017
    Posts:
    6
    I'm using VRIK for a player rig in a game that I'm working on, and I'm having a lot of difficulty with the rig whenever I teleport. I'm using NewtonVR's teleporter without tunneling, so everytime the player teleports they should be at the new position instantaneously. My problem is that whenever I teleport, the player rig has to slide at ungodly speeds to keep up with the player's new position, resulting in a ton of jankiness that was really jarring to some of my playtesters (especially when loading a new level and putting the player in start position). I thought an easy solution was just putting the player model as a child of the NVR Player, but to no avail. I also tried disabling locomotion, but that ended up not looking that great. Anyone got any tips?
     
  8. breenen

    breenen

    Joined:
    Aug 7, 2018
    Posts:
    5
    Hi, looks like a great asset.
    I need to know before purchasing...
    I will be using Oculus VR, and need a full body avatar, which i see i can do, however, is it possible to push my analoge stick forward and get the player to walk, with a walking animation? is this built in? or something I will need to build.
    Thank you
     
  9. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    If the legs are always stretched, it could help just to scale up the character. But that wouldn't improve the weird look of that procedural locomotion on that very realistic character. You'd probably get better results if you disabled locomotion and used a simple strafing animation blend tree to make the character follow the horizontal direction towards the HMD with root motion and/or scripting. I've used Kubold's animation assets for the animations, they look pretty good with VRIK.

    Hey,
    Did you try calling ik.solver.Reset() after moving the avatar to the new position?

    Hey,
    It's not built in, but it's possible. There is a procedural locomotion solver built in, but that only looks good in certain situations and definitely not good for walking from A to B or room-scale. I'd recommend using a simple strafing animation blend tree to make the character follow the horizontal direction towards the HMD with root motion and/or scripting. That way you can have your physical and thumbstick locomotion look the same.

    Best,
    Pärtel
     
  10. BeyondInfiniti

    BeyondInfiniti

    Joined:
    Jun 24, 2018
    Posts:
    15
    Hi,
    I have animation when using the thumbstick locomotion and the procedural locomotion when not. The problem I have is when I use thumbstick locomotion with the animation and I physically move my body at the same time the legs stay in the same position, so if I physically move back while thumbstick moving the legs are too forward. I'm thinking I could just reset the solver once the HMD has moved a certain distance from the previous locomotion solver position, or is there a better way?
     
    Last edited: Feb 22, 2019
  11. asb9599

    asb9599

    Joined:
    Oct 22, 2017
    Posts:
    6
    That worked beautifully, thank you so much! Now, to tackle a different problem I'm having, I think I need some serious guidance for how to get the hands working properly. Right now, in basic default settings with the VR IK rig, the hands of the player model are oriented in a completely different way from the VR Controllers that I have the IK targets on. I fixed this manually by rotating the IK targets to somewhat match what I want them to look like, but that ended up looking really bad. So, I figured it was worth asking what the best approach to fixing this issue might be. Here is what the rig looks like with the IK targets not rotated properly, as well as all the settings and such

    My game also has this inventory system for weapons and such that uses VRTK to attach the items to the controllers, but I want the player's hands to be gripping them and I have no idea how I would go about that with VR IK. That's a separate problem, seeing as how the hands do not orient properly regardless of the weapons. I would greatly appreciate some advice on the best way to approach these two problems to make everything integrate smoothly with the rig to establish the proper player presence my game is going for.
     
    Last edited: Feb 24, 2019
  12. trianglesoup

    trianglesoup

    Joined:
    Jun 9, 2017
    Posts:
    3
    Hi I've been using the Full Body Biped IK to help ensure combat animations (punches etc) land correctly on different sized enemy characters. The problem I am having is that when the character needs to hit someone taller than them there is no movement coming from the character clavicles which looks really unnatural. Is there a way to have the clavicles included in the Full Body solve? Also is there a way to encourage the solving to move the hips forward if the arms at full extent would not reach their goal?

    Thanks a lot for the help!
     
  13. Celiken

    Celiken

    Joined:
    Jun 1, 2017
    Posts:
    5
    We're having the same problem, but not on all our avatar, some are perfect, others are, like your, perpendicular to the arm.
    The only way we found fixing this is by rotating the hand target to match the correct way. Not sure though if there is a generic rotation for every avatar that must be followed or if it depending on the avatar RIG.
     
  14. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey, sorry for the delay!

    Did you try calling ik.solver.Reset() before you re-enable the procedural locomotion?

    Hey,
    Can't you just rotate the IK targets 90 degrees to match the guns? I mean it should work, if the IK targets are child objects of the controllers, not the controllers themselves. About VRTK, please try this package. Requires VRTK and Oculus (as VRTK doesn't seem to agree with the latest SteamVR plugin). Its a WIP interaction system for VRIK and VRTK or other custom VR grabbing solution.

    Hey,
    Please try adding ShoulderRotator.cs to the character. Its a tool that makes FBBIK use the clavicles, but there is a performance downside as it makes FBBIK solve twice a frame. You could also just make a script that rotates the clavicles towards the hand target in LateUpdate, something like this:

    Code (CSharp):
    1. Quaternion r = Quaternion.FromToRotation(shoulder.rotation * shoulderAxis, handTarget.position - shoulder.position);
    2. r = Quaternion.Slerp(Quaternion.identity, r, shoulderWeight);
    3. shoulder.rotation = r * shoulder.rotation;
    Hey, yes, the problem there is that the IK works by matching the hand bone rotation to the target rotation, it doesn't have a generic hand rotation like the Humanoids in Unity (as VRIK can also be used on non-humanoids). So the IK target rotation needs to be set for each character with unique bone orientations). It can be automated though, if you added gameobjects to the rig that represent the HMD and hand controllers, I mean make new objects, move them to the head and hands of the model as they were held by the model. Then you can create the IK targets by script like this:

    Code (CSharp):
    1. var leftHandTarget = new GameObject("Left Hand IK Target").transform;
    2. leftHandTarget.parent = leftHandAnchor; // The hand controller
    3. leftHandTarget.localPosition = leftHandPosedAnchor.InverseTransformPoint(ik.references.leftHand.position);
    4. leftHandTarget.localRotation = Quaternion.Inverse(leftHandPosedAnchor.rotation) * ik.references.leftHand.rotation;
    So leftHandAnchor is the left hand controller transform and leftHandPosedAnchor is that anchor posed to the left hand of the model.

    Best,
    Pärtel
     
  15. BeyondInfiniti

    BeyondInfiniti

    Joined:
    Jun 24, 2018
    Posts:
    15
    I figured it out! I got the solution from an older post of yours from 2016. This is what I wanted to do:

    Code (CSharp):
    1.         Vector3 d = avatarIK.solver.spine.headTarget.position - avatarIK.references.root.position;
    2.         d.y = 0f;
    3.         float mag = d.magnitude;
    4.         float maxHeadDistance = 0.1f;
    5.  
    6.         if (mag > maxHeadDistance)
    7.             avatarIK.references.root.position += d.normalized * (mag - maxHeadDistance);
     
    Last edited: Feb 27, 2019
    Partel-Lang likes this.
  16. LazyOnion

    LazyOnion

    Joined:
    Mar 6, 2018
    Posts:
    22
    Hey partel, I ve been using VRIK_VRTK and I can't figure out how to grab an object and then return the hand model to the default tracker pose. I ve tried applying the difference between the bones to the transform prior to the pickup, but it doesn't work (maybe vrtk is getting in the way?)

    this.transform.rotation *= QuaTools.FromToRotation(pose.bones[0].transform.rotation, modelHand.transform.rotation);



    handPose.png
     
  17. igoraleftinovich

    igoraleftinovich

    Joined:
    Feb 11, 2017
    Posts:
    17
    Hey to all! Is there any callback to do something when foot has placed to the ground? I want to add impulse to an objects when the player steps on it.
     
  18. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    Is that with the VRIK_VRTK_InteractionSystem? In the demo, the fingers seem to go back back to default nicely, it is done by HandModel.cs that is added to the hand bones by VRIKInteractionSystem. How can I reproduce this?

    Hey,
    I guess this question is about the Grounder? The Grounder has no idea if the foot is touching the ground or not, it only applies offset to the animated height of the feet based on ground height at foot position:

    Best,
    Pärtel
     
  19. LazyOnion

    LazyOnion

    Joined:
    Mar 6, 2018
    Posts:
    22
    I dont mean when releasing the object to return it to its prior position, that works fine. I mean I would like to grab an object and the return the hand to its natural condition,while having the object grabbed, to the default position of the controller (same rotation as the iktarget). This way the user feels more natural with his hands while holding something.
    handPose_army.png leftHand.png
     
    ROBYER1 likes this.
  20. Esmond0

    Esmond0

    Joined:
    Nov 22, 2017
    Posts:
    8
    I want to add weapon sway to my first person shooter, but cannot seem to get the Inertia script to give me the desired look. I've got AimIK and FinalIK already working properly, but can't seem to get Inertia working without being jerky.

    Does anyone have any experience with this type of problem? Or am I going about this all wrong?
     
  21. Hivemind9000

    Hivemind9000

    Joined:
    Mar 2, 2014
    Posts:
    11
    Hi Partel. I'm having a problem with FBBIK where if a leg is hyper extended, the whole leg (thigh, shin and foot) flips around the Y axis and faces backwards. This happens even when the limb has no effectors or bend goals set. The "maintain foot rotation" fixes the foot but not the leg. I searched through this thread and found something you had posted in 2014 and modified it slightly (in order to rotate the thigh bone instead of the shin bone).

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using RootMotion.FinalIK;
    4. [RequireComponent(typeof(FullBodyBipedIK))]
    5. public class FixLimbRoll : MonoBehaviour {
    6.     // Fixes the roll rotation of the first bone relative to the parent bone of a limb
    7.     [System.Serializable]
    8.     public class Limb {
    9.         public FullBodyBipedChain chain;
    10.         [Range(0f, 1f)] public float fixWeight = 1f;
    11.         private Vector3 axis;
    12.         private Quaternion defaultLocalRotation;
    13.         private Transform firstBone, secondBone, thirdBone, parentBone;
    14.         private IKSolverFullBodyBiped solver;
    15.         public void Initiate(IKSolverFullBodyBiped solver) {
    16.             this.solver = solver;
    17.             // Some quick references
    18.             firstBone = solver.GetChain(chain).nodes[0].transform;
    19.             secondBone = solver.GetChain(chain).nodes[1].transform;
    20.             thirdBone = solver.GetChain(chain).nodes[2].transform;
    21.  
    22.             parentBone = firstBone.parent; // Hip (leg) or Abdomen (arm)
    23.  
    24.             // Remember the default rotations of the elbow knee bones relative to the first bones of the respecitve limbs
    25.             defaultLocalRotation = Quaternion.Inverse(parentBone.rotation) * firstBone.rotation; // Not using localRotation because there might be twist bones in between
    26.         }
    27.         public void OnPreRead(IKSolverFullBodyBiped solver) {
    28.             if (fixWeight <= 0f) return;
    29.             if (this.solver == null || firstBone != solver.GetChain(chain).nodes[0].transform) Initiate(solver); // Something has changed, reinitiate
    30.             // Read the local axes of the elbow/knee bones towards the end bones
    31.             axis = Quaternion.Inverse(firstBone.rotation) * (secondBone.position - firstBone.position);
    32.         }
    33.         public void OnPostUpdate() {
    34.             if (fixWeight <= 0f) return;
    35.             // Rotate to default local rotation, which fixes the roll, then swing back to the solved direction
    36.             Vector3 direction = firstBone.rotation * axis;
    37.          
    38.             Quaternion r = parentBone.rotation * defaultLocalRotation;
    39.             r = Quaternion.FromToRotation(r * axis, direction) * r;
    40.          
    41.             if (fixWeight >= 1f) {
    42.                 firstBone.rotation = r;
    43.             } else {
    44.                 firstBone.rotation = Quaternion.Lerp(firstBone.rotation, r, fixWeight * solver.IKPositionWeight);
    45.             }
    46.         }
    47.     }
    48.     public Limb[] limbs;
    49.     private FullBodyBipedIK ik;
    50.     void Start() {
    51.         ik = GetComponent<FullBodyBipedIK>();
    52.         foreach (Limb limb in limbs) limb.Initiate(ik.solver);
    53.         ik.solver.OnPreRead += OnPreRead;
    54.         ik.solver.OnPostUpdate += OnPostUpdate;
    55.     }
    56.     // Called by FBBIK each frame before reading the pose of the character
    57.     private void OnPreRead() {
    58.         if (!enabled) return;
    59.      
    60.         foreach (Limb limb in limbs) limb.OnPreRead(ik.solver);
    61.     }
    62.     // Called by FBBIK each frame after finished updating
    63.     private void OnPostUpdate() {
    64.         if (!enabled) return;
    65.      
    66.         foreach (Limb limb in limbs) limb.OnPostUpdate();
    67.     }
    68.     // Clean up the delegates
    69.     void OnDestroy() {
    70.         if (ik != null) {
    71.             ik.solver.OnPreRead -= OnPreRead;
    72.             ik.solver.OnPostUpdate -= OnPostUpdate;
    73.         }
    74.     }
    75. }
    While this works most of the time there are still some weird artifacts (leg twitches sideways sometimes) and it also stiffens the legs so that the feet slide/skate around instead of being grounded. Is there a better fix for this in 2019?
     
    Last edited: Mar 2, 2019
  22. obi38

    obi38

    Joined:
    Nov 13, 2018
    Posts:
    5
    Hello Partel, can you please reupload the demo file, I have the same issue than RickyX and I want to see the demo to solve my problem. thanks you
     
  23. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    OK, I see what you mean. Spent the whole day trying to fix it, because there was a bug in VRTK regarding it's snap handles. Please import the new VRIK Interaction System from here. Also, you'll need to go to VRTK_BaseJointGrabAttach.cs, comment out these lines in protected virtual void SetSnappedObjectPosition() line 117:
    Code (CSharp):
    1. //obj.transform.rotation = controllerAttachPoint.transform.rotation * Quaternion.Euler(grabbedSnapHandle.transform.localEulerAngles);
    2.                 //obj.transform.position = controllerAttachPoint.transform.position - (grabbedSnapHandle.transform.position - obj.transform.position);
    And replace them with this:
    Code (CSharp):
    1. // Fixing snap handle bug in VRTK
    2.                 Vector3 p = grabbedSnapHandle.transform.InverseTransformPoint(obj.transform.position);
    3.                 Quaternion r = Quaternion.Inverse(grabbedSnapHandle.transform.rotation) * obj.transform.rotation;
    4.  
    5.                 obj.transform.position = controllerAttachPoint.transform.TransformPoint(p);
    6.                 obj.transform.rotation = controllerAttachPoint.transform.rotation * r;
    to fix the bug in VRTK. Then just set "Precision Grab" to false in VRTK_FixedJointGrabAttach components on your interactable objects.

    Hey,
    Inertia might not work well with all kinds of IK setups and combinations, there might be something conflicting with it, but can't really guess. If you could send me a repro or something, I'd take a look of course.

    Hey,
    Does it happen when the leg is extended in animation or when you pull it by the foot effector?
    When you select the FBBIK gameobject in the editor, do you see any yellow or red dots on the knees in the scene view (while not playing)?

    Hey,
    This post must be really old. Nowadays you can just add AimController.cs and enable "Use Animated Aim Direction" in it.
     
    Last edited: Mar 5, 2019
  24. obi38

    obi38

    Joined:
    Nov 13, 2018
    Posts:
    5
    I try to resolve the problem with AimController.cs and the "Use animation direction" parameter but it still don't work. I really don't kown how to resolve the problem and I'm stucked on since couple weeks
     
  25. LazyOnion

    LazyOnion

    Joined:
    Mar 6, 2018
    Posts:
    22
  26. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    Can you please give me more information about what exactly is not working or send a repro to support@root-motion.com?

    Best,
    Pärtel
     
  27. nubdev

    nubdev

    Joined:
    Mar 30, 2013
    Posts:
    87
    Hi Pärtel, how can you reset or manually position the euler angles of the gameobject using CameraController.cs on start? For instance inheriting parent or target rotation as a start point?

    Simply setting rotation on Start does not work, so does creating a buffer bool / routine that sets the rotation before allowing the camera transform to be updated via the existing function. Is it the mouse axis that is overwriting this?
     
    Last edited: Mar 8, 2019
  28. unity_3drapidsolutions

    unity_3drapidsolutions

    Joined:
    Nov 18, 2017
    Posts:
    21
    Hi Pärtel!

    Three quick questions:

    (1) When I am using your VRIK Locomotion package that you provided here, I often have one of the two following issues:

    (a) If I hit run in the unity editor, sometimes the scene will load with the character animations working but root motion not applying. The character simply moves in place. It appears to happen most often when the headset is not fully seated on my head prior to hitting the play button on the editor.
    (b) If I move the X axis of the right controller left/right, the character is supposed to rotate via the VRTK hand controller scripts. However, if my character rotates at all it typically loses the ability to move with root motion (i.e. after rotating the character only moves in place with animations but no root motion movement).

    I am under the impression that this is likely a bug with the VRIK locomotion script due to my internal debugging. I believe the solution may be to use the reset() function which you built in, but I am not sure how to implement it.

    (2) Due to these issues I want to move away from using VRTK to rotate my main player with the right thumbstick. Is there a better method to rotate the character? I've tried using rotation on the player prefab, but due to the tight implementation with VRTK, the VRIK Animated Locomotion Script and the Avatar Model/Avatar Setup scripts you have released previously, I cannot simply rotate this prefab. I've also tried rotating the root VRTK_SDK Manager, which works but rotates the player in an orbit around the scene origin instead of locally rotating the player.

    (3) Every time I browse through this forum I see that you release useful packages with good code snippets for a variety of scenarios. Do you have a database of these packages online for easier browsing (instead of going through 70+ pages of forum)? I understand that the small code snippets you write here are likely not found anywhere else, but I am hoping for a database of your package add-ons.

    Thanks!!
     
  29. Ziron999

    Ziron999

    Joined:
    Jan 22, 2014
    Posts:
    282
    does anyone have performance tests for this vs standard baked unity mecanim animations from a 3rd party animator?
     
  30. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    Please go to CameraController.cs and add this:
    Code (CSharp):
    1.  public void SetAngles(Quaternion rotation)
    2.         {
    3.             Vector3 euler = rotation.eulerAngles;
    4.             this.x = euler.y;
    5.             this.y = euler.x;
    6.         }
    7.  
    8.         public void SetAngles(float yaw, float pitch)
    9.         {
    10.             this.x = yaw;
    11.             this.y = pitch;
    12.         }
    Then you can call those methods to update camera angles.

    Hey,
    (a and (b) No idea what stops the root motion, but I don't think it's anything related to VRIK or VRIKAnimatedLocomotion. Does it happen if you disable VRIKAnimatedLocomotion?
    (2) You should rotate the VRTK_SDKManager, but after you do, also move it to keep the head where it was:
    -store centerEyeAnchor position
    -rotate SDKManager
    - move SDKManager by storedCenterEyeAnchorPos - centerEyeAnchor.position

    (3) Should do that indeed, thanks for pointing that out. I'll add it in my todo list. I'll probably find a place on my website or add them to Plugins/RootMotion/FinalIK/_Integration.

    Hey,
    Final IK is not a tool for creating animations nor is it a Mecanim substitute. It was designed for making real-time procedural adjustments to the baked animation to better match it to the dynamic game environment, so it basically works on top of Mecanim like a layer.

    Best,
    Pärtel
     
  31. Hivemind9000

    Hivemind9000

    Joined:
    Mar 2, 2014
    Posts:
    11
    The leg is extended as part of a dancing animation. No effectors are active (all weights are zero) but the overall weight setting is > 0 (normally close to 1). It does seem to be doing the same rotation artifact as when you pull on an arm or leg effector hard and it flips backwards. It would be nice to be able to stop these limit rotation artifacts if possible.

    I don't see any red or yellow dots. When in the editor all I see is the blue dots, and when the game is running I see the red sphere indicators (line drawn) - see images below:

    ScreenClip.png

    ScreenClip.png
     
  32. Xeverian

    Xeverian

    Joined:
    Sep 23, 2016
    Posts:
    12
    I'm trying to import the FinalIK to Unity 2017.4 and getting tons of these errors. Does anyone know how to fix it? FinalIKImportErr.png
     
  33. nubdev

    nubdev

    Joined:
    Mar 30, 2013
    Posts:
    87
    Thank you very much!
     
  34. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    Can you please send me the character fbx and the dance animation to support@root-motion com so I could take a closer look?

    Hey,
    This usually happens if you have originally downloaded Final IK with Unity 2018, then imported it to a lower version later. The store has different versions of the package for different Unity versions. It's the new AnimationJob-based multithreaded AimIKJ and CCDIKJ solvers that can't be used in older Unity versions.
    To fix it, just delete "Plugins/RootMotion/Editor/FinalIK/IK Jobs" and "Plugins/RootMotion/FinalIK/IK Jobs".
    You can reimport them at any time from "Plugins/RootMotion/FinalIK/_Integration" if you update Unity.

    Cheers,
    Pärtel
     
    renem likes this.
  35. TrinityD

    TrinityD

    Joined:
    Jan 27, 2019
    Posts:
    4
    Hello, just implemented biped IK and grounderBipedIK
    but when i spawn i can clearily see foots of the model is under ground (a bit)
    How can i fix it? and why it so?(without final ik it was ok)
    regards.
     
  36. gliealonso

    gliealonso

    Joined:
    Oct 21, 2018
    Posts:
    117
    Hi there,

    Whenever my character rig is on Generic mode, the VRIK doesn´t work, it only works on Humanoid mode, how do I fix that?

    Because I want to use 4 bones per arm, due to the Twist Relaxer issue, so the arm joints can look smoother, and on Humanoid mode, it only appears 2 bones per arm as you can see from the image:

    Another question is, I was checking out the Pilot prefab, and it does have 4 bones per arm and it's on Humanoid mode, how is that possible?

    Many thanks!
    Gabriel.
     

    Attached Files:

  37. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    If you play the animation without any IK and select the root of the character, do you see the feet going below the root Y?
    If you don't, make sure the "Root" transform assigned to BipedIK Refences is the root of the character or a child Transform that is exactly at the same position.
    If still no luck, please try adjusting "Height Offset" in Grounder.
    If all that does not help, please send me the character fbx and the animation clip via PM or support@root-motion.com.

    VRIK is supposed to work with Generic, also Legacy. It only needs a hierarchical bone structure. Maybe you were adding VRIK in runtime, so the automatic detection of References fails? In that case, you'll need to assign the bone refs in ik.references manually. Any warnings/errors in the Console?

    About the 4 bones in Humanoid arm, I didn't know that was an issue with Humanoids at all. If you look at the Pilot's avatar configuration, you'll see the 4 bones and 2 of them assigned as upper arm/forearm.

    Best,
    Pärtel
     
  38. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    Hi, Partel,
    I think I finished the initial round of integration and FinalIK is very flexible and powerful. I can pretty much replace many animations including various styles of recoils, and Crouch movements, saving quite a bit of resources.

    Since this is my first experience, I'm not sure if I'm doing it right but I'm sure there are ways to improve the setup.

    Right now, my concern is that I need to do this to 100s of other characters and I'm not sure it will scale to that many characters or not.

    FYI, I'm creating 3rd person shooter like PUBG. I'll explain the setup briefly and please let me know if there are rooms for improvement.

    I'm using FinalIK to do Offset Pose, Aim, Recoil, Left-Hand placement, LookAt and etc. I think a typical shooter will need to do all that.

    So here it is my setup.

    1. I first bring Right Hand to a position where I want it to be. Right Hand can be closer or farther to your chest depends on the firing mode such as Hip Fire, Aim Fire, ADS Fire. I use FBBIK to place the Right Hand.

    2. I need to Aim the weapon to the target. I use AimIK to set up Aim.

    3. Then, I use FBBIK again to place the Left Hand to the weapon's fixed position.

    4. There is a Recoil component so that when the weapon is fired Right Hand and Shoulder will kick back. I hook Recoil into #3 FBBIK

    That's the basic setup but I have a couple of more but it's not directly related to the weapon handling, i.e., LookAtIK, GrounderIK, and FBBIKHeadEffector.

    And here are my feedback and questions.

    1. The thing is Recoil and FBBIKHeadEffector are hooked into FBBIK's callback but I have to solve FBBIK two times, thus, I have to make sure Recoil and FBBIKHeadEffector is called only once by a hack. It's probably not a very good idea to have two FBBIK solvers in one Frame. I was wondering if there is a way to get around it. If AimIK is flexible enough, I can perhaps merge #1 and #2 together into AimIK. Or you have some other ways to get around it?

    2. I was wondering if it's possible to provide ShooterIK component to merge all of the above (#1 ~ #4) into a single component. When you think about it, most of the weapon handling will need all of them anyway but setting up is quite difficult and having it to solve multiple times will be quite bad for the performance. If we can merge them into one solver, it will be quite awesome and be very useful for those who are using FinalIK for weapon handling. Perhaps include LookAtIK, GrounderIK, FBBIKHeadEffector to the component as well if it can improve the performance.

    I think that's all I have to say for now but I'm sure there will be more as I learn more. FinalIK became indispensable for my project now and I really appreciate it for such a wonderful product.

    Cheers!
     
  39. V--R

    V--R

    Joined:
    Sep 4, 2014
    Posts:
    4
    Will final ik be updating it's playmaker integration to include controls for vrik? I'd like very much to be able to set targets for the points within my game and to change values on the fly. But as far as I can tell there's no way to do it. I've tried playmaker's set property feature but it doesn't seem to be able to get to where it needs for like the head targets and stuff.
     
    gliealonso likes this.
  40. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    It's definitely not a ideal to solve FBBIK twice per frame, especially when you have a lot of characters, there is usually a more efficient way to calculate all the IK target positions, even if combined by multiple procedures, and then have the IK solve once. I didn't quite understand though, why can you not use the solution as described in the "Third Person Shooter" demo?

    Hey,
    I'll add it to my list. It's quite a long one though, I'm currently already way behind with some of the stuff I've promised..

    Cheers,
    Pärtel
     
    gliealonso likes this.
  41. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    Hi, Partel, thanks for the reply. I've looked at "Third Person Shooter" scene and the problem is that when I change "Gun Hold Offset", the Aim will also move and the Aim becomes inaccurate. That's the reason I have to solve FBBIK twice. I hope there is a way to get around it. Thanks.
     
  42. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,433
    If I try to combine Final IK's LookAtIK with the "Dynamic Bone" plugin (white spheres) to animate un-animated bones such as hanging hair, this seems to be in conflict with the LookAtIK solver. The un-animated bones which are a child of the head end up with double the deflection but only when LookAtIK is enabled. The LookAtIK "Fix Transforms" has no effect. (Note here I also have isolated and disabled FBBIK which has no effect.)



    Edit: It appears I can add the Dynamic Bone plugin script below the LookAtIK script in the "Project Settings > Script Execution Order" and it works correctly.

    (Honestly I was hoping Final IK or Active Ragdoll had a simple dangle/physics bone solution so I didn't have to keep adding more redundant colliders on everything.)
     
    Last edited: Mar 17, 2019
    gliealonso likes this.
  43. Hivemind9000

    Hivemind9000

    Joined:
    Mar 2, 2014
    Posts:
    11
    Hi Partel. While I was trying to put together a simple scene to show the problem I found the issue. I was setting the
    solver.IKPositionWeight to 0.99 instead of 1. For whatever reason this was causing the animation glitches. All solved now - many thanks for your help. :)
     
  44. Roamer79

    Roamer79

    Joined:
    Oct 25, 2016
    Posts:
    45
    Hi Partel,

    How can I simply stop everything below the waist rotate and move via code?
     
  45. adelheidgonschorek

    adelheidgonschorek

    Joined:
    Feb 2, 2019
    Posts:
    1
    Hello,
    i'm using VRIK and want to add some shoulder trackers. Now i'm struggling how i will get the shoulders to follow them. Does anyone know if there is a way to do this? Adding shoulder effectors or something like this?
    Thanks to u all!
     
  46. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hey,
    Ok, I see... in that case, it would be much more efficient to make AimIK solve twice instead, as it is much faster than FBBIK. In the Third Person Shooter demo, add another AimIK(); after FBBIK(); in line 60 in AnimatorController3rdPersonIK.cs and that will fix the aiming for you. Another option, if you just need to fix 1 arm position, would be to use a pass of LimbIK on that arm instead of FBBIK.

    Hey,
    Yeah, glad you found the answer, DynamicBone needs to run after Final IK components, otherwise FIK adjustments to the animation would be ignored by DynamicBone.
    Final IK is a kinematics package though, so adding bone dynamics would be a bit out of scope I think.

    Hey,
    Could you be more specific please, is this question about a specific IK component like VRIK or FBBIK or something else? Did you mean you wanted to stop the animation entirely or just an IK component like FBBIK from having any effect on the lower body.

    Hey,
    VRIK doesn't support shoulder targets, sorry. I just haven't heard of anyone needing that before. Maybe it could be custom scripted though.. If you go to IKSolverVRArm.cs and add a public Transform shoulderTarget;

    Then comment out all the code that rotates the shoulders (starting with if (hasShoulder && shoulderRotationWeight > 0f) around line 264) and replace it with this:

    Code (CSharp):
    1.  Quaternion toShoulderTarget = Quaternion.FromToRotation(upperArm.solverPosition - shoulder.solverPosition, shoulderTarget.position - shoulder.solverPosition);
    2.                             VirtualBone.RotateBy(bones, 0, toShoulderTarget);
    Best,
    Pärtel
     
  47. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    Great! AimIK I just replaced the first FBBIK with LimbIK. It works like a charm! Many thanks.
     
  48. auroraland

    auroraland

    Joined:
    Dec 7, 2017
    Posts:
    5
    Hey Partel!

    Great work on this so far, loving everything! Now I just have to wrap my head around the nuances of the system.

    Speaking of, I'm currently using a tracked HMD and VRIK on the model, and I'm trying to reconcile two things:
    1) I want the "smart" feet placement when I move with my headset,
    2) But I also want to use my own walking animation in certain cases (i.e. user presses forward).

    So far, the best I've gone is set VRIK.locomotion = 0 in those cases, and back to 1 after, then calling VRIK.solver.Reset(), but there's a lag where the feet slowly fall back into a fixed place at varying times. Is there a way I can reset without this lag time at the end?
     
    Last edited: Mar 21, 2019
  49. Roamer79

    Roamer79

    Joined:
    Oct 25, 2016
    Posts:
    45
    I'm talking about using VRIK component and having it have no effect on the lower body. Make sense?
     
  50. gliealonso

    gliealonso

    Joined:
    Oct 21, 2018
    Posts:
    117
    Hi Partel,

    Where can I find the baker clip to record motion capture? And is there a tutorial?

    Many thanks!