Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. 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. octanta_studio

    octanta_studio

    Joined:
    Mar 9, 2022
    Posts:
    1
    Hello, I need help with Final VR IK. I use Final VR Ik and Twist Relaxers to prevent the wrist from twisting unnaturally. But because of this, it turns out that the elbow does not twist well (examples in the screenshots). What to do to fix elbow rotation?

    I tried using additional logic to limit the rotation of the elbow from -90 to 90 in the Y axis, but due to the influence of the VR IR script, my edits have no effect on the rotation of the bones. For example, I tried rotation constraint, twist correction, built-in final ik rotation limits. Nothing helps. I would be grateful for clear instructions on what and where to edit in order to achieve realistic smooth rotation in this conditions.

     
  2. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Did you try this?

    void LateUpdate() {
    if (!Application.isPlaying) director.Evaluate();
    }
     
  3. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    Don't know all the specifics of this model and its skinning so can't give you clear instructions to solve it, but you can add multiple twist solvers to the twist relaxers. So you can relax forearm roll bone and then relax the elbow bone and then the upper arm roll bone. Basically even out twist angles of all the bones from wrist to shoulder.

    Best,
    Pärtel
     
  4. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    288
    Just done making my own Wall Climb + Wall Slide + Wall Kick system.
    Final IK helps greatly with the visuals since those wall interaction without IK would look real bad.
    Thank you Partel Lang for selling best plugin! :D

    With the help of IK, Wall Climb only needs 5 animations: center idle, climb up, climb down, climb left, and climb right.
    Wall Climb

    Wall Slide + Wall Kick
     
    Partel-Lang and Serinx like this.
  5. Serinx

    Serinx

    Joined:
    Mar 31, 2014
    Posts:
    790
    Hi, I've run into a couple of issues/questions with FinalIK I'm wondering if somebody here can help.

    1. (issue) I've got a bow object set as a child of the hand on my character. I'm using AimIK and Full Body Biped IK with my character. The problem is when I shoot the bow, the transform.position reported by the bow is incorrect, it's returning the position of the root character, so the arrow spawns at their feet. When I disable Full Body Biped IK it reports the correct position and shoots from the bow. I resorted to getting the position in Update and storing it for later retrieval but this seems hacky. Is this a bug or am I missing something?

    Edit: I forgot to mention I retrieve the transform.position during an animation event called from the shoot arrow animation if that makes a difference.

    2. (question) I've got a character controller with all the scripts for the character. I've got multiple child characters that I toggle on and off depending on the chosen character. Each one of these children has their own skeleton and therefore their own Full Body IK, Aim IK, and Interaction System. Is this the right way to do it? I thought about putting these components on the top level gameobject but then I'd have to swap out the dependencies each time I changed characters (e.g. point to the correct skeleton).

    Appreciate any help :)
     
  6. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    288
    I get my actual bone position in the BeforeIKUpdate (fullBody.solver.OnPreUpdate)
    for example: fullBody.references.leftHand.position;

    Setup character with separated skeleton and components, yes.
    For example: Top level: important stuffs, I do have some child gameobjects that hold other scripts, because then I see the top level one has so many components it looks clunky.
    Of course, when you switch to setup another character, you have to re-check all the references, mostly the skeleton references, but that's unavoidable imho, would like to hear about everyone solution for this. I never think about the setup that have many characters inside one prefab.
     
  7. Serinx

    Serinx

    Joined:
    Mar 31, 2014
    Posts:
    790
    @Spikebor thanks for the feedback. Regarding issue 2, I decided to make a base prefab that holds all the player scripts, then created prefab variants for each of my characters. It does mean I have to make all FBBIK and AimIK adjustments to each individual character, but it means I don't have to swap references via script when choosing a character, I just spawn in a different prefab variant.

    I have another question - I added in an AimIK for a 2handed spear thrust animation. Currently, I've got the spear in the right hand, but the left hand kinda just floats nearby. what should I use to fix the left hand to the spear at a certain point? I tried using FBBIK to position the hand on the spear but I think it's conflicting with the AImIK? I found a tutorial video where they write some code to position the left hand on a gun but it's quite old and I'm not sure if that's still the expected way to handle it. If it is though - I'm happy to try that!

    This is the animation I'm using btw, I changed the height to the lowest possible setting:
    https://www.mixamo.com/#/?page=1&query=bayonet+stab

     
  8. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Haha, looking great! thanks for sharing! :D

    Hey,
    1.
    It's just an issue with the update order of things. The arrow is being shot before the IK has updated for the frame. If you use animation events, instead of firing directly from there, just raise a flag to fire it later, after the IK is done.

    Code (CSharp):
    1. bool shootArrowFlag;
    2.  
    3. void AnimEvent_ShootArrow() {
    4.     shootArrowFlag = true;
    5. }
    6.  
    7. void LateUpdate() {
    8.     if (shootArrowFlag) {
    9.         ShootArrow();
    10.         shootArrowFlag = false;
    11.     }
    12. }
    Make sure that script has a higher value in the Script Execution Order than Final IK components have or use the ik.solver.OnPostUpdate delegate instead of LateUpdate.

    2. It would be ideal if all skins shared the same skeleton so you could just swap the skins by (de)activating the renderers. If that's not possible, I'd consider constructing all IK components by script when the player chooses their character.

    3. About the spear. If the animation already has the left hand floating and not properly connected to the spear, then the easiest way to fix it would be to fix it in the 3D app that was used to create the animation or using something like UMotion Pro in Unity. It's possible to fix the left hand to the spear with IK, but then you'll need to manage IK weights when the left hand is supposed to let go of the spear etc, so not very elegant.
    The tutorial is about using LimbIK or FBBIK to put the left hand back to where it was on the gun before AimIK moved the right arm bones and broke the connection. So the idea there is to store the pos/rot of the left hand relative to the right hand before any IK, do the AimIK, then run LimbIK/FBBIK on top of that to put the left hand back to where it was relative to the right hand.

    Best,
    Pärtel
     
    Spikebor and Serinx like this.
  9. dorcsyful

    dorcsyful

    Joined:
    Mar 29, 2017
    Posts:
    2
    Did you manage to figure this out? It seems my model has a similar structure but I haven't been able to get the elbow to work.
     
  10. Serinx

    Serinx

    Joined:
    Mar 31, 2014
    Posts:
    790
    @Partel-Lang thanks for the replies! I’ll try out the suggestions.
     
  11. Enkianthus

    Enkianthus

    Joined:
    Mar 28, 2022
    Posts:
    23


    I tried it again, but it still doesn't work. Using this LateUpdate during runtime has the same effect as not using it at all.


    I did come up with a solution, but it's a bit cumbersome to use. It involves placing the Humanoid Animation Clip in a Timeline and using director.Evaluate() to update the pose in LateUpdate. Then, in another Timeline, record the position and rotation of the effector to create IK animations, and synchronize the time of the first Timeline with the second one.

    Perhaps there's a better approach


    PS: I also tried modifying the animation like this in the Editor,make ik update in Edit Mode, but encountered the same issue. Although the Unity Timeline is more suitable for creating animations in the Editor, I feel that it seems more reasonable to create animations like IK animations in PlayMode. This way, it won't mess up my scene.
     
    Last edited: Mar 22, 2024
  12. dorcsyful

    dorcsyful

    Joined:
    Mar 29, 2017
    Posts:
    2
    Is it possible to use VR IK and CCD IK at the same time? I'm trying to set up thumb movement for my rig. I wanted to use CCD with the bones being the 3 bones of the thumb + 1 at the endpoint, however I'm getting different results depending on whether or not the VR IK is component is enabled as shown in the picture (fix transforms is enabled in the VR IK component). The point where the cube is on the second picture changes as the hand is moved but never goes back to the correct position or if I do manually drag it there the finger is twisted around.
     
  13. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey, can you share a video or some screenshots and the twistrelaxer setup you used please?

    Oh, sorry I totally misunderstood your previous post at first... but glad you figured out something already, I can't think of anything better at the moment.

    Hey,
    It's probably because CCD is by default solved earlier than VRIK. But in this case you need to solve VRIK first to place the hand, then the CCD. Always solve IK in the same order as the hierarchy of the bones that they use. For example when you solve head look-at first to look at a target and then solve some spine IK, the head will end up looking wrong because it is parented to the spine bones that get rotated later.
    You can change the IK execution order by using the IKExecutionOrder component. Don't try to change the Script Execution Order of FIK components, it is hardcoded, so your changes will be reverted.

    Btw, there's also the FingerRig solver for fingers, check out the "Finger Rig" demo.

    Best,
    Pärtel
     
  14. botove

    botove

    Joined:
    Apr 10, 2015
    Posts:
    52
    Hello, i need to get bone transform data, like position and rotation, after ik is applied. if i understand right final ik updates stuff in late update, so what will be possible solution for this? thanks!
     
  15. SammmZ

    SammmZ

    Joined:
    Aug 13, 2014
    Posts:
    174
    I would try to create a script that will get those transforms in late update and ensure that script execution order is set in a way it will run after the IK calculation.
     
    botove likes this.
  16. Enkianthus

    Enkianthus

    Joined:
    Mar 28, 2022
    Posts:
    23
    I suddenly had an interesting(maybe a bit stupid) idea, which is to create an IKConstrain extension for Unity's Animation Rigging based on Final IK's full body biped IK. I just started using Unity's Animation Rigging, and I found that when I enable animation recording mode with Timeline, the character's rig also automatically activates. Moreover, at the end of the preview, the character also returns to its original position and pose, which is very convenient for animation production, and its workflow is also quite reasonable. I can easily combine multiple IK constraints and adjust their update order as well as control their weights uniformly. However, the provided IK functionality is quite limited. Some people have tried to use those IK to create full body rigs for characters, but their effects are far from satisfactory compared to the results achieved with FBBIK.
    https://assetstore.unity.com/packages/tools/animation/control-rig-249848
    https://assetstore.unity.com/packages/tools/animation/pca-procedural-character-animator-194793

    If there is a way to integrate other IK solutions into the Animation Rigging workflow, it could provide a better workflow and user experience for other IK solutions, and also bring more advanced IK algorithms to Animation Rigging.

    So, I want to combine full body biped IK with Animation Rigging. Is this feasible?
     
    Last edited: Apr 2, 2024
  17. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    Yes, what SammmZ kindly suggested. Also, can use the ik.solver.OnPostUpdate delegate or make a script that disables the ik component in Start and updates it from LateUpdate via ik.solver.Update() and then reads the transforms.

    Hey,
    It would take a complete rewrite of FBBIK using the animation jobs. But seeing how Unity has decided to chase some kind of a "dream animation solution" and neglect the working one (Mecanim along with animation rigging, animation jobs etc) while they're at it, I'm not willing to invest any more time into building solutions for abandoned systems.

    Cheers,
    Pärtel
     
  18. Krayt78

    Krayt78

    Joined:
    Jun 18, 2018
    Posts:
    3
    Hello everyone ! Has anyone managed to do full auto fire with the procedural recoil in the first person demo ? looks like even calling fire on update doesnt trigger the offset every frame, cant quite wrap my head arround the code... ^^'
     
  19. Krayt78

    Krayt78

    Joined:
    Jun 18, 2018
    Posts:
    3
    For those that will ahve the same issue in the future, i was calling everyframe which wasnt smart, i instead setup some RPM for my weapon and called the fire recoil only when it should fire a bullet and now it works like a charm.
     
    Partel-Lang likes this.
  20. copperrobot

    copperrobot

    Joined:
    May 22, 2013
    Posts:
    69
    I imported the package into a Unity project (Unity 22.3.21f1) and got this in IKExecutionOrder and other scripts:



    The line is here:

    Code (CSharp):
    1.     private bool animatePhysics {
    2.             get {
    3.                 if (animator != null) return animator.updateMode == AnimatorUpdateMode.Fixed;
    4.                 if (legacy != null) return legacy.animatePhysics;
    5.                 return false;
    6.             }
    7.         }
    There is indeed no 'Fixed' in AnimatorUpdateMode

    I could however just changed everything to 'normal' and the errors go away, but I am thinking there's probably a reason to stay 'fixed'?
     
  21. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    It should have been fixed by the automatic Unity API updater, did you perhaps select "No" when it asked to update the API? Anyway, please change all these instances of "Fixed" to "AnimatePhysics".

    Best,
    Pärtel
     
  22. Eros96

    Eros96

    Joined:
    Sep 26, 2019
    Posts:
    30
    Hello, I am trying to replicate the Driving Rig from VRIK (Basic) scene that use just VRIK to calibrate, but using the vrik calibration controller.
    Upper body: after some adjustment to targets position and rotation wrt to the demo scene (left avatar), now is very similar as you can see from the image (right avatar).
    Legs: No metter what position/rotation I apply to the targets, after pressing C to calibrate, the legs of right avatar will never bend as in the left avatar.. Anybody know how can I do that?
    This is just a testcase btw, the general goal is to have an avatar seated where the upperbody is controlled by the user while the lower body is seated (becouse the user will be seated), for this reason the need of Vrik Calibration Controller. Thank you for the help.
     
  23. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    288
    Hi Partel, I'm experimenting with the Grounder Quadruped, I tried to have the effect that when character move at high speed = the leg swings out much more than the animation, can it be done with that component?
    I tried to change the foot radius, max step, foot speed, prediction, all do not affect the swinging result.
    This is the same control the EffectorOffset component does, but too bad the Grounder Quadruped is not about FBBIK so it can't be used, is there an equivalent component for generic IK like that EffectorOffset?
     
  24. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    I need to play an animation on my character’s hand to point something, which is paused on an interaction target on gun. Is there any way to do this without resuming the interaction?
     
  25. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    511
    Hi, this post was old. You told me to use the Twist Relaxer script, and that solved my problem. However, it seems this script has changed now, and I can’t achieve the same result as the previous Twist Relaxer script

    Is the old script still available?
     
    Last edited: Apr 22, 2024
  26. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey.
    VRIKCalibrator was designed to calibrate VRIK to a player wearing additional trackers, it was never meant to do driving rig setup. That driving rig in the demo was set up manually. Basically I posed the dummy to the seat, then made duplicates of its toe and hand and pelvis bones and assigned them as VRIK's foot, hand and pelvis targets. HandPoser on the hand bones takes care of posing the fingers.

    Hey,
    Grounder just adjusts foot angles and positions only vertically. But you can use grounder.OnPostGrounder delegate to get a call from grounder right before its IK components are updated, if you need to add some position offset to the target positions of the IK solvers.

    Hey,
    Could make a script to move the InteractionTarget (in LateUpdate) that the hand is paused to, to a position and rotation that points at whatever you need to point, then moves it back to its initial localPosition/Rotation.

    Hey,
    TwistRelaxers were restructured to TwistRelaxer and TwistSolver for version 2.0, so I guess you had version 1.9 or earlier before? Here's TwistRelaxer.cs like it was in 1.9. You'll have to delete TwistRelaxer.cs, TwistSolver.cs and TwistRelaxerBiperIK.cs before importing it.

    Best,
    Pärtel
     
    Spikebor likes this.
  27. BeautyBoxingBunny

    BeautyBoxingBunny

    Joined:
    Apr 15, 2024
    Posts:
    10
    Hi Partel,

    I've been working on an animation where each finger independently reaches for a piano key, requiring a complex IK setup that allows multi-end effectors and branching. The goal is for each piano key target to drive the corresponding finger's movement and subsequently influence the entire arm and body motion. Despite various attempts, I haven't found a successful solution.


    Initially, I set up a FABRIK chain from the thumb tip to the arm, and this configuration worked well; the arm's movement was effectively driven by the thumb reaching its target.
    upload_2024-4-26_16-44-19.png
    *entering play mode:
    upload_2024-4-26_16-53-3.png


    However, when I tried to replicate this setup for the other fingers, assigning a FABRIK chain from each fingertip to the arm, the IK solver did not converges badly, while the thumb continued to reach its target effectively (becuase it is firstly assigned), the other fingers failed to reach their respective targets, even though moving their targets did induce some motions to the arm. upload_2024-4-26_16-31-5.png

    *poorly coverged

    upload_2024-4-26_16-40-17.png


    upload_2024-4-26_16-41-17.png


    I've tried numerous methods to solve for multiple branches and targets that share the same root. I know this could be accomplished using the FABRIK root component, by setting a FABRIK chain for each finger and adding the five FABRIK chains as children of the arm chain. However, the FABRIK root requires that each chain be independent, which isn't applicable in my case because every finger chain shares the same parent (the wrist) in the bone hierarchy. And due to modeling limitations, I cannot make each finger an individual chain for this.

    I've also experimented with the Finger Rig and other components, but none have resolved the problem. Also considering the complexity and variability of finger positions during piano play, i think it is impossible to set up an animation for each state.

    So, to rephrase, how can I set up IK for multiple end effectors on branches within a parent-child hierarchy? Have been stuck on this problem for days now and it's driving me nuts. Could really use some help, thanks so lot!
     
  28. ChescoRed

    ChescoRed

    Joined:
    Sep 29, 2018
    Posts:
    35
    Hello everyone, let's see if someone can give me some clue, it turns out that if I create the character with the VRIK within OVRPlayerController, its movements are perfect.

    Since I am starting to experiment with multiplayer themes and I have to instantiate the character where the VRIK is located, it does so outside of the OVRPlayerController and although both hands and head are tracked, when moving it around the stage you see jumps in the itself, and what is more serious, it always remains at the initial height that has been instantiated, not following the OVRPlayerController if I go up a mountain or staircase.

    Thank you very much for your help.
     
  29. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    288
    EDIT! FinalIK does solved my issue as I dig in!
    Wow this solution is so great guys :D!
    Code (CSharp):
    1.         // For overriding ray/capsule/sphere casting functions
    2.         public delegate bool OnRaycastDelegate(Vector3 origin, Vector3 direction, out RaycastHit hitInfo, float maxDistance, int layerMask, QueryTriggerInteraction queryTriggerInteraction);
    3.         public OnRaycastDelegate Raycast = Physics.Raycast;
    4.  
    5.         public delegate bool OnCapsuleCastDelegate(Vector3 point1, Vector3 point2, float radius, Vector3 direction, out RaycastHit hitInfo, float maxDistance, int layerMask, QueryTriggerInteraction queryTriggerInteraction);
    6.         public OnCapsuleCastDelegate CapsuleCast = Physics.CapsuleCast;
    7.  
    8.         public delegate bool OnSphereCastDelegate(Vector3 origin, float radius, Vector3 direction, out RaycastHit hitInfo, float maxDistance, int layerMask, QueryTriggerInteraction queryTriggerInteraction);
    9.         public OnSphereCastDelegate SphereCast = Physics.SphereCast;
    10.  
    Hi Partel,
    My game having a feature that a character can treat other character as climbable / stand able platform, which resulted in the Motor (character capsule) can collide/stand on other character's limbs/body colliders.

    For most games, usually the body colliders are in a layer that cannot collide with the Motor.
    So for most games, the GrounderIK can just set to collide with Default, and the Lion body colliders set to layer Character and the GrounderIKwill never ray cast on Lion's body colliders.
    Yet in my game, my character wants to stand on the Lion and vice versa, so the Grounder should set layer to Default+Character.
    And result is the Lion GrounderIK will ray cast on its own colliders.

    My game setup leading to me having issue with various plugins, including Final IK.
    For my own scripts, I can do just fine by ignore the character own body colliders with its ray casting, but for other plugins I have to edit the plugin to add that feature.

    Is there a better way around this? Did you work with a game with this feature before? I'm curious how would you solve this problem?
     
    Last edited: Apr 30, 2024
    Partel-Lang likes this.
  30. Desfell07

    Desfell07

    Joined:
    Mar 27, 2019
    Posts:
    1
    Hello! Sorry if I missed something in the manual, but in my case AimIK seems to override LookAtIK. I use LookAtController and AimController to set their targets. However when I disable and enable LookAtIK, it fixes itself. Any ideas? Thanks for reading! IKIssue.png
     
  31. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    I haven't tried doing piano IK myself, but this is how I'd get started: calculate optimal wrist position based on all the pressed keys, like calculate the centroid of the keys and add some world space offset to that. Then you can apply some additional constraints on it if necessary, like make sure the pinky is able to reach its target by comparing distance from wrist target to pinky target to pinky length + pinky to wrist length and offset wrist target position if it's too far to reach. Use LimbIK or ArmIK to move the wrist to that location. Then all you should need is FingerRig to place the fingers on the keys.

    Hey, can you please share a video of the "jumps" you were seeing?
    About the height, VRIK locomotion never changes the Y position of the root because VRIK doesn't know how you plan to move your character. It should be fine if you just parent the avatar to the OVRPlayerController or make a script that updates the avatar's Y position to match that of the OVRPC.

    Hey,
    Looks like maybe a problem with the update order of things. Please try adding AimController and LookAtController to the Scipt Execution Order to values 9994 and 9995 respectively.

    Best,
    Pärtel
     
  32. BeautyBoxingBunny

    BeautyBoxingBunny

    Joined:
    Apr 15, 2024
    Posts:
    10
    Hi Pärtel,

    Thanks for your suggestion! and this is exactly what I thought initially, by calculating the wrist position based on the keys pressed at the instance, and using finger rig to position the fingers on the keys.

    However upon implementation of this method i realise that this wont generate a realistic hand movement and posture. The main reason is that human piano playing is like this: the fingers determine and drive what the wrist and the arm, and to the body, should move accordingly, instead of the wrist leading to the finger positions. A simple example is that, during piano playing, according to human physiology, a pianist will always tend to minimize the wrist motion (horizontally across the keyboard), so as to minimize the overall arm and body muscle tension.

    However, if we calculate the wrist positions based on the notes that should be played at the instance, it is very likely that any combination of notes or chords will result in a different wrist position, which further implies that the wrist will move very frequently. In realistic piano playing, a good fingering can many times ensure zero wrist movement because the finger movements will compensate for the wrist move.

    Although it is possible to use a better algorithm to determine the wrist position, considering realistic piano playing movements (which is what I want to achieve), using IK to solve for every finger, such that the fingers will contribute to the whole body movements, should achieve the best effect. (btw i already have a algoritm to determine the fingering for every keys/notes)

    What I was thinking now is to use full-body biped IK to solve for multiple finger targets (piano keys/notes). I think this might need some extra scripting, but I am not quite sure where to get started. Do you have any idea about it? Thank you so much for your help again!
     
    Last edited: May 3, 2024
  33. BeautyBoxingBunny

    BeautyBoxingBunny

    Joined:
    Apr 15, 2024
    Posts:
    10
    Hi, why the scene view editor is not showing in my scene?

    upload_2024-5-6_1-22-8.png upload_2024-5-6_1-22-36.png

    upload_2024-5-6_1-25-30.png
     
  34. BeautyBoxingBunny

    BeautyBoxingBunny

    Joined:
    Apr 15, 2024
    Posts:
    10
    I have come up to a solution (if overhead is not an issue), which is to use Fabrik root like this:
    upload_2024-5-10_3-13-40.png
    The problem is that this set up invoves so much chains and end effectors and wont converge well (i.e. each finger touching their target) unless the iteration is set to a very high value (up to 100 iterations for my case), which leads to significant performance issue.

    I now understand why Partel was not recommanding this approach at the first place...
     
    Last edited: May 11, 2024
  35. BeautyBoxingBunny

    BeautyBoxingBunny

    Joined:
    Apr 15, 2024
    Posts:
    10
    A temporary fix to this problem is to remove the [HideInInspector] flag so that it can be adjusted directly in the inspector.
    upload_2024-5-11_12-44-26.png upload_2024-5-11_12-44-54.png

    However the underlying cause of this scene view gui not displaying is still not figured out
     

    Attached Files:

  36. suzuki-tai

    suzuki-tai

    Joined:
    Nov 8, 2021
    Posts:
    8
    Hello, FinalIK is really useful and I have been using it while customizing it.
    I am currently working on a blending mechanism on a timeline.

    I would like to ask frankly, is there an API to access joint information (movement, rotation) before applying IK in FBBIK?
    I ask this question because I want to create a blend of IK destination target and unapplied IK points.

    Thanks.
     
  37. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    288
  38. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey guys, sorry for the very long delay, had some traveling to do...

    Hey,
    Sorry, but I can't think of any good way to do something like this with FBBIK, the solver ends at the wrists. But perhaps you could apply some smoothing to the wrist position so it wouldn't snap too much when a finger target moves and/or iterate the solvers a couple of times, I mean if a finger is unable to reach, adjust wrist position by the vector from that finger tip to its target and then solve the fingers again. With 3 or 4 iterations the wrist should be in range for all the fingers to reach. That's how VRIK adjusts the hips so that all toes remain planted if you have "plant feet" enabled.

    Which Unity version is that please? Might be that Unity bug that happens sometimes when you update Unity version and OnSceneGUI just stops working. In that case choosing one of the default layouts from the top right corner and then rearranging the windows as you like them helps.

    Hey,
    Normally you can read bone rotations before IK is applied if you do it from LateUpdate. FIK components by default update from LateUpdate too, but after your own scripts because they have set themselves to a very high value in the Script Execution Order. You can also use the ik.OnPreUpdate and OnPostUpdate delegates to get a call from them right before/after they update.

    Hey,
    Not sure what you mean by building them into FABRIK. FABRIK can be solved on top of those animation rigging constraints though.

    Best,
    Pärtel
     
  39. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    288
    I mean suggestion to add twist module to FABRIK like those examples, I do not plan to use animation rigging.
    My current attempt at it. Correct me if I'm wrong, I did not find a twist script for FABRIK in the plugin so I write it.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using RootMotion.FinalIK;
    5. using SPIKE;
    6.  
    7. namespace FinalIKIntegrationSpace {
    8.     public class FABRIKTwister : MonoBehaviour
    9.     {
    10.         public FABRIK ik;
    11.  
    12.         [Range(0f, 1f)] public float weight = 1f;
    13.  
    14.         void Start()
    15.         {
    16.             ik.solver.OnPreIteration += OnPreIteration;
    17.         }
    18.  
    19.         private void OnValidate()
    20.         {
    21.             if (ik == null) return;
    22.         }
    23.  
    24.         void OnPreIteration(int iteration)
    25.         {
    26.             int i = 0;
    27.             var finalRot = transform.rotation;
    28.             var length = ik.solver.bones.Length;
    29.             if (length == 0) return;
    30.  
    31.             foreach (var bone in ik.solver.bones) {
    32.                 var t = i * 1f /(length-1);
    33.                 bone.solverRotation= Quaternion.Slerp(bone.solverRotation, finalRot, t*weight);
    34.                 i++;
    35.             }
    36.             //this apply of final rotation (not solver rotation) will give the FABRIK very flexible rotation
    37.             ik.solver.bones.Last().transform.rotation = finalRot;
    38.         }
    39.     }
    40.  
    41. }
    42.  
     
  40. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    511
    Is it possible to modify the weight of this section "Aim IK" programmatically? I’m unable to locate the relevant parameter in Playmaker.

    WOTS.png
     
  41. toannmVMO

    toannmVMO

    Joined:
    May 15, 2024
    Posts:
    1
    Is it possible to rotate the character in the X axis instead of the head and the head only in the Y axis when using VRIK (Steam VR)?
    I tried forcing them to update but it left the arms in the wrong position. The character hugs itself when the user rotates 180 degrees Even though the real hand is facing forward
     
  42. BeautyBoxingBunny

    BeautyBoxingBunny

    Joined:
    Apr 15, 2024
    Posts:
    10
    Hello Pärtel, Why the fingers are bented in a wrong direction and are twisted when i am using the Finger Rig component?

    upload_2024-5-22_5-30-51.png upload_2024-5-22_5-31-29.png upload_2024-5-22_5-32-14.png upload_2024-5-22_5-33-11.png
     

    Attached Files:

  43. Frpmta

    Frpmta

    Joined:
    Nov 30, 2013
    Posts:
    498
    Is there a way to leave the feet grounded no matter what bone bendings occur in the pelvis, spine and above?
     
    Last edited: May 22, 2024
  44. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    Nice! That's a very interesting solution, glad you managed to dig in and figure it out :)

    Hey,
    ik.solver.bones[index].weight = something;

    Hey,
    Not sure I understood what you mean. I think you could do that using a chest goal. If you assign that in the spine settings and set chest goal weight to 1, you'll get another target that you can use to control the direction of the chest that is independent from the head.

    Hey,
    FingerRig samples the pose of the hand at start to find out which way to bend the fingers, so I'm guessing those fingers are completely straight. Please try posing the fingers in a more natural relaxed way in the editor.

    Hey,
    If that question is about VRIK, you can enable "Plant Feet" for the solver.

    Cheers,
    Pärtel
     
    toannmVMO likes this.
  45. NathanielAH

    NathanielAH

    Joined:
    Jul 22, 2013
    Posts:
    113
    Errors - FinalIK & PuppetMaster

    I am getting a set of errors for FinalIK & PuppetMaster. I am on 2022.3.30f1. I downloaded the package and imported. I have re-downloaded and re-imported as well, with no fix.

    Any help is appreciated.

    upload_2024-6-2_18-21-1.png
     
  46. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    In Unity 2023.1 they renamed AnimatorUpdateMode.AnimatePhysics to AnimatorUpdateMode.Fixed (just for S***s and giggles). Final IK has packages in the Asset Store built with 2022.3.13 and 2023.1.20. For some reason you got the latter in 2022.3.30f with the renaming in the API already done.
    So please either try re-downloading with an earlier version of Unity in another project and reinstalling to your real project or opening up those erroneous scripts and just renaming AnimatorUpdateMode.Fixed to AnimatorUpdateMode.AnimatePhysics wherever you can find them.

    Best,
    Pärtel
     
    NathanielAH likes this.
  47. NathanielAH

    NathanielAH

    Joined:
    Jul 22, 2013
    Posts:
    113
    Understood. Will do. Thank you for the guidance!
     
  48. cloverme

    cloverme

    Joined:
    Apr 6, 2018
    Posts:
    200
    I'm working on integrating some animations for climbing poles and ladders. FinalIK has done wonders for me in the past, so I'm wondering what might be a good strategy to align hands and feet as the model moves... Anyone done any setups for climbing?
     
  49. suzuki-tai

    suzuki-tai

    Joined:
    Nov 8, 2021
    Posts:
    8
    Hello.

    Thank you for answering my last question.
    I am thrilled with the great assets and excellent support.
    I know this is similar to the kissing rig sample, but I am struggling with it, so I would like to ask a question.

    Is it possible to pass an arbitrary point A and a joint B defined within FBBIK and place joint B at arbitrary point A without changing the pose posture?
    (For example, if there is a crouching motion and we pass the neck bone and place it at point (0,0,0), the position of the neck joint will be (0,0,0) while the crouching posture is maintained.)

    I know it is possible to obtain this without using IK, but since the system relies on FBBIK, I would like to be able to do this within the IK calculation if possible.
     
  50. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    So many different ways people approach climbing. Depends on if you have your climbable objects in standardized scales or are you expecting to be able to climb any random surface (which can make the climbing system insanely complex, like Assassins Creed). With FBBIK you could just move the root of the character in the direction you want to climb, then make a script that looks for grabbable objects for each limb within a certain range from the most comfortable position. If it finds another point that is closer, move the hand/foot IK target to that.

    Hey, I'm sorry I don't think I understood the question. If you have the character crouching move the neck bone to (0, 0, 0) without changing the posture, wouldn't it just look like this?
    upload_2024-6-14_15-20-3.png