Search Unity

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

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

  1. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi!

    Can you make the redirecting work without (1) keeping the Kaiju's head oriented towards the target? I mean exactly like in the AimBoxing demo...
    I mean it's easier to focus on one thing at a time, then once you have that, add the head orientation, as it should be the last bone to rotate anyway.

    Cheers,
    Pärtel
     
    FaffyWaffles and The_Least like this.
  2. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Each limb has a "Pull" value, set pull to 0 for the hands and 1 for the legs. Also try adjusting the "Reach" value of the arms.

    About wrist rotation, set "Rotation Weight" to 1 for the hand effector, then you are also able to rotate the handle and the wrist with it.
     
    FaffyWaffles likes this.
  3. The_Least

    The_Least

    Joined:
    Jan 21, 2015
    Posts:
    27
    I am such an idiot! Isolating the solvers should have been my first step. I quickly worked out that my problem was two-fold:

    1) My punch animation wasn't set to fix the root motion on import (I'm using Mecanim for player controls), so the pelvis rotation and translation was playing havoc with the solver *AND* shifting the aim as the animation played, since the player movement caused the camera to move which threw the aim off.

    2) My LookAt IK was controlling both the spine and the neck, now it's just controlling the neck.

    It's all working beautifully now:


    Now I can focus on building more things to punch and burn. Thanks Partel!
     
  4. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    That is one mighty beast! :D
     
    FaffyWaffles and The_Least like this.
  5. jake-Kim

    jake-Kim

    Joined:
    Aug 15, 2012
    Posts:
    8
    In 3rdPersonDummy Scene.

    while Left foward or right forward moving, Legs movement of the dummy is wrong.

    How to fix it?
     
  6. ixikos

    ixikos

    Joined:
    Jun 21, 2013
    Posts:
    26
    I love your work! Are you planning on doing a Unity 5 version anytime soon or should we migrate the code base on our own?
     
  7. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi!
    Weird, I didn't notice the twitching while making the demo. It seems to be a Mecanim animation retargeting issue. It goes away when you uncheck "Foot IK" in the "Walking" animation state in the Animator. That will make backward walking animation weird though, but that can be fixed if you open the import settings of the animation, click on configure avatar and rotate his leg bones to be in make him stand in T-pose. I will make those fixes myself too for future releases.

    Thanks! As far as I have tested, FinalIK migrates to Unity5 without any problems, just let Unity convert the API for you.
    The new Asset Store publisher tools allegedly let us upload packages for multiple versions of Unity so I'll probably look at that.

    Cheers,
    Pärtel
     
  8. directx

    directx

    Joined:
    Dec 11, 2014
    Posts:
    47
    after i move the scripts
    Assets/Plugins/RootMotion/FinalIK/IK Solvers/Editor/IKSolverInspector.cs(11,41): error CS0246: The type or namespace name `Inspector' could not be found. Are you missing a using directive or an assembly reference?
     
  9. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    The RootMotion/Scripts/Editor folder also needs to be taken out from the "Plugins" folder.
     
    Last edited: Feb 19, 2015
  10. The_Least

    The_Least

    Joined:
    Jan 21, 2015
    Posts:
    27
    Is there any way to have a particle emitter take FinalIK's procedural animation into account? I'd really like to set my Kaiju's flames to World Space for more dynamic motion, but in doing so it resets the emitter's transform to the childed spawnpoint before any IK is calculated.
     
  11. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    You could not parent the emitter to the head, but write a script that sets it's position to the head in each LateUpdate. Add that script to the Edit/Project Settings/Script Execution Order to a higher value than Final IK components have.
     
  12. The_Least

    The_Least

    Joined:
    Jan 21, 2015
    Posts:
    27
    Perfect, thanks! I'd tried setting it's position in LateUpdate, but didn't think to change the Script Execution Order - now it's working perfectly.
     
  13. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    Back from a long break, so what is aimIK in the code you gave me ? It seems to bring me red text, which ofc means it has an error... From the looks of it, it doesen't know what aimIK is, is it stored in your libraries or you just randomly typed that, what should i replace it with ? What kind of vartable is it ?
     
  14. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Its just a reference to the AimIK component. You need to add
    Code (CSharp):
    1. public AimIK aimIK;
    and assign it in the Editor.
     
  15. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    Alrighty :) Sooo, i'm gonna test the code finally.
     
  16. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    haha, it works, but how do i disable it now ? Thanks man, i just couldn't bealive this would be this simple.
     
    FaffyWaffles likes this.
  17. redchurch

    redchurch

    Joined:
    Jun 24, 2012
    Posts:
    63
    I have been considering this packae to prototype a 3rd person game and I had what are probably newbie questions that didn't seem obvious to me from watching videos, reading the documentation, and the forum.

    I read that you can't save IK pose or movements to animations, so how do you use it then? Do you have to script everything or is there some way of "saving" the IK alterted animation and movements to a state that can be easily triggered, or how does this work? What are the most common ways of using/triggering Final IK features?

    I am trying to get an idea for how much coding work there will be as I am beginner to intermediate... Writing an extensive character system that integrates Final IK maybe be a little outside my skill level. I was hoping this didn't prevent me from using it.

    Thanks!
     
  18. niosop2

    niosop2

    Joined:
    Jul 23, 2009
    Posts:
    1,059
    FinalIK is really a runtime solution. If you have the opportunity to bake stuff, you might as well do it in your 3d package. It shines for situations where you don't know what the desired target position will be prior to runtime and need to calculate a plausible pose. The best results are obtained by using traditional animations and tweaking them slightly with FinalIK to get them to match up with the world.

    For all but the simplest scenarios there is going to be some scripting involved. Setting weights, turning it on and off, setting or moving targets, etc are going to need to be done via code most of the time. Some of the pre-built stuff like the grounder components can be done w/ little or no code. A lot of times you're going to need to modify a little bit of code to make other stuff work in LateUpdate instead of Update so that they can get the updated position to work with.
     
    redchurch likes this.
  19. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    Partel,

    Hi ! Me aaagain... The code you gave me does leave the aim to aim in one direction and disable it's weight so the shoot animation can play right, BUUT. The direction that it's aiming at is not right, it aims somewhere whole diffrent than it should. To remind you of our conversation, if you forgot me, our conversation went in 19th page of this thread.

    Once again, what i wanted to do is to disable FinalIK's (AIMIK's) animation weight, in order to play a shoot animation properlly, becouse when i play an animation over the AimIK, the AimIK took most of the weight of the anim so the shoot is blocked, i can only see a slight move in arms when i play it. So what i want is to stop an AimIK for a second, but still have it to aim at the wanted target, and play a shoot animation, and when it's done, to turn AimIK's functions on again. How would i do this, your code seems to work, it disable's the anim weight of AimIK, my shoot anim plays normally, but it doesen't aim where it was aiming before, it just starts to aim somewhere in the sky, wierd... I tried changing character.forward, to the target's position that is the real actual target for the aiming, still the same.
     
  20. The_Least

    The_Least

    Joined:
    Jan 21, 2015
    Posts:
    27
    Well this is a little odd. I just upgraded my project to Unity 5, and my AimIK and LookAtIK are arguing with each other again. AimIK seems to be fine, but LookAtIK is off-target... until I disable and renable the component (via the checkbox) while playing, after that it all works perfectly. Any idea what's going on?
     
  21. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi, you can disable this behaviour smoothly by just lerping the axis back to whatever it was at start:

    Code (CSharp):
    1. Vector3 x = aimIK.solver.transform.InverseTransformDirection(character.forward);
    2.             aimIK.solver.axis = Vector3.Lerp(originalAxis, x, weight);
    Hi,
    Niosop2 is right (thanks!), however note that there are code examples provided in the package for almost everything. :)

    That sounds odd, can you send me a picture or something? I'm not sure I understand whats going on.

    Hi,
    It sounds like an execution order issue.
    Click on the AimIK/LookAtIK components in the scene, that should make them check themselves back into the script execution order.
    If that doesn't work, remember you can always take full control by disabling the ik components at Start and updating their solvers manually in LateUpdate:

    Code (CSharp):
    1. void Start() {
    2.             aimIK.Disable();
    3.             lookAtIK.Disable();
    4.         }
    5.  
    6.         void LateUpdate() {
    7.             aimIK.solver.Update();
    8.             lookAtIK.solver.Update();
    9.         }
     
    The_Least likes this.
  22. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    I just managed to finally submit Final IK 0.5. I was planning to that last week, but was hit by a big wave of support cases (happens from time to time) :).
    Hopefully it is accepted before the weekend.

    Anyway, I submitted both Unity 4 and Unity 5 versions, so if you have Unity5 running, it will automatically download the correct version.
     
    WendelinReich likes this.
  23. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    Partel, i'm sorry but i cannot show any content of the game yet, i can explain it more clear this time.

    I have a character.
    I added a pistol to him, instead of the gun from the scene(also left the laser for testing, but on the pistol instead)
    I set up the lookAtIK and AimIK to target to a cube.
    I played a pistol aim animation.
    I made the cube to follow the camera's middle, and made a crosshair on the middle of the screen.
    So AimIK now target's a character torso to aim at that cube, works like charm, well ofcourse.
    I made more modifications in codes, tons more, but i said the most important things.

    Now what i want is to play a pistol shoot animation.
    When i play it, the character plays it, but the weight is really low, becouse AimIK's weight is overriding it, probbably, might be my opinion, but the animation works normally without the AimIK, so it's probbably AimIK which is taking out it's weight.
    This is supposed to be like that, right ?
    So now, the code you gave me, really doesen't make sense to me, becouse you set it to something like "Character.forward", while my target is not that, it's the position of the cube that's following my crosshair.
    I tried the code, the character just aims somewhere in air.
    But the aimation gets a nice weight now, works normally.
    I want the thing to still stay at the cube target, but to give advantage of weight to the pistol shoot animation.

    Can you understand now any better :/ ? I don't know how to explain better really, i'm stuck here. Thank you for taking time.
     
  24. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Thanks for the extra info..

    Using character.forward there presumes the gun is aimed precisely forward in the animation. So it is not the direction towards the target, it is the direction relative to the character that the gun is aimed at in the animation. So If you had an aim right animation you should write character.right instead. The problem might be that the gun is not aiming exactly forward in your animation, but a bit up so the aim ends up offset.

    The line tells AimIK that the axis that is facing character forward is the axis that should be aimed at the target. That's how the shooting/reloading animation is preserved. If you are sure the gun is aiming straight forward in the animation, it might also be another IK component (LookAtIK?) that solves before AimIK and messes it up.

    Pärtel
     
  25. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    Beside all the misunderstanding that you just cleared out to me about character.forward, it still doesen't work like you mentioned... It works, kinda, but it doesen't aim straight forward, it aims in the air... You said it might be LookAtIK ? I've got that enabled too, could that be the thing that's messing it up really ?
     
  26. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Only way to know is to disable LookAtIK and see what happens.
     
  27. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    Mhm, i'm gonna try it out.
     
  28. Crusare

    Crusare

    Joined:
    Feb 14, 2014
    Posts:
    21
    Hi everyone!

    I've got a 3rd person platformer. What I do is while I'm on the ground, the legs are placed on the ground with a Grounder, but when I jump on a ledge, I need the arms to be placed exactly on the ledge (only on a specific layer) -- basically I need a grounder for arms. How would I do this with Final IK?
     
  29. The_Least

    The_Least

    Joined:
    Jan 21, 2015
    Posts:
    27
    Thanks for responding. Clicking on the components didn't solve it, and your script led to some crazy behaviour (probably my fault), but it inspired me to add this script to the character:


    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using RootMotion.FinalIK;
    4.  
    5. public class FinalIK_Reset : MonoBehaviour {
    6.    
    7.     public LookAtIK lookAtIK;
    8.  
    9.     void Awake () {
    10.             lookAtIK = gameObject.GetComponent<LookAtIK> ();
    11.             lookAtIK.enabled = false;
    12.         }
    13.  
    14.     void Start () {
    15.         lookAtIK.enabled = true;
    16.     }
    17.  
    This essentially automates my workaround of disabling/enabling the LookAtIK component after pressing play, and it works. Maybe it's a Unity 5 beta thing? Anyway, it's working fine for me now - I'll check again when Unity 5 comes out of beta. Thanks again!
     
  30. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    Partel,
    the annoying and boring guy is back ! (me)
    Well, i tested it without lookIK, but same stuff... And also, your code for disabling the thing also didn't work, it just changed weight to old again, and my character doesn't want to aim at the cube, crosshair target again... The code is small, i edited your example code actually.


    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. namespace RootMotion.FinalIK.Demos {
    6.  
    7.     /// <summary>
    8.     /// Character controller for the simple AimIK aiming system demo.
    9.     /// </summary>
    10.     public class CharacterControllerSimpleAim : MonoBehaviour {
    11.  
    12.         public SimpleAimingSystem aimingSystem;
    13.         public Transform target;
    14.         public Transform TestTestTest2; //test value 2 /
    15.         public AimIK aimIK;
    16.         public Transform Character;
    17.  
    18.         void LateUpdate () {
    19.             // Update aiming system target position
    20.             aimingSystem.targetPosition = target.position;
    21.  
    22.             CharacterScript CS = gameObject.GetComponent<CharacterScript>();//
    23.  
    24.             if(CS.TookShoot == true)
    25.             {
    26.                 aimIK.solver.axis = aimIK.solver.transform.InverseTransformDirection(CS.gameObject.transform.forward);
    27.             }
    28.             else
    29.             {
    30.                 Vector3 x = aimIK.solver.transform.InverseTransformDirection(CS.gameObject.transform.forward);
    31.                 aimIK.solver.axis = Vector3.Lerp(target.position, x, 1);
    32.             }
    33.         }
    34.         void FixedUpdate()
    35.         {
    36.             CharacterScript CS = gameObject.GetComponent<CharacterScript>();//
    37.             AimIK AIK = gameObject.GetComponent<AimIK>();//
    38.             SimpleAimingSystem SAS = gameObject.GetComponent<SimpleAimingSystem>();//
    39.             FullBodyBipedIK FBBIK = gameObject.GetComponent<FullBodyBipedIK>();//
    40.          
    41.             if (/*CS.CanActivateAim == false */ CS.TookShoot != true)
    42.             {
    43.                 SAS.enabled = false;
    44.                 AIK.enabled = false;
    45.                 FBBIK.enabled = true;
    46.             }
    47.             else
    48.             {
    49.                 SAS.enabled = true;
    50.                 AIK.enabled = true;
    51.                 FBBIK.enabled = false;
    52.             }
    53.  
    54.         }
    55.     }
    56. }
    57.  
    Basically, what i did there is checked if my character's script's TookShoot value is true, if it is, do the code you sent, if it isn't, disable it.
    While in fixed update i also told it to enable aimIK and lookAtIK only if my character's script's value TookShoot is true.
    Also FBBIK which is not important here.
    This results in :
    -When TookShoot is true: character aiming in one direction (Not group "One Direction" lol xD) which is somewhere in air, and not the actual "target" value that's stored in this code, without this code, before, i've had it aiming straight to the target value. only thing that's good is that weight is given to shoot animation now, which is the only thing i wanted to change actually, the wieght.
    -When TookShoot is false: same as true but this time the weight was taken away again, like good old times, but still not aiming at the target.

    Soo yeaah, what the hell is the problem here :/ I'm really confused...

    EDIT: I set the values in component section inside unity too, so it's not that just so you know...
     
    Last edited: Feb 24, 2015
  31. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi, Ricky.

    I made a demo for you.
    If you play the scene, you'll see the Dummy walking and aiming with superhuman skills, keeping the gun targeted perfectly at all times. If you disable AimIK for a sec, you'll see that the animation is not like that, in the animation the gun is swaying about a bit and hanging to the left. Reenable AimIK and set "Maintain Animation Weight" to 1 in the AimIKAxisController.cs component on the character. Now you see that the weapon's animation is maintained, it is not fixed to the target, like AimIK normally would have it. And you are still able to change the general aiming direction by moving the target around. It works exactly the same with recoil and reload animations. You can make a cowboy style animation with spinning the revolver around a finger if you wish, without AimIK interfering.

    If Maintain Animation Weight is 1 and your gun is aiming up or somewhere else, you just need to adjust the "Animated Aiming Direction." Remember it needs to be the same direction your gun is aimed at in the animation.

    Take a look at AnimIKAxisController.cs to see how it works, it's just a few lines of code.

    Cheers,
    Pärtel
     
  32. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    I have no idea how it makes it work. Maybe in Unity5 the execution order of things has changed. That's why I always recommend taking full control of it (using ik.Disable() and ik.solver.Update()) when you have multiple IK components on a character. The execution order of scripts in Unity is a bit fishy and quite random (unless defined in the Script Execution Order), might vary between scenes and projects.
     
  33. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    I have an idea for a tool that would "project" a FBBIK character to any surface in a similar way to Grounder, but its still an idea and I'm not even sure if it would work.

    But in the meanwhile, you could do a raycast/spherecast from the hands to find the ledges, then just pin the hand effectors to the contact point. Pin weight could be determined by a Mecanim curve (if you have Pro) or just use an AnimationCurve and evaluate it by normalized time of the currently playing animation state.
     
  34. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Final IK 0.5 is now available on the Store!

    Make sure to read the release notes. A lot of assets were replaced, removed or reorganized so the correct way to upgrade would be to:
    1. Make a complete backup of your project,
    2. Open an empty scene, delete the entire RootMotion folder, update from the Store, reimport.

    Some of the changes/improvements in 0.5:

    Added the Head Effector for FullBodyBipedIK.

    Created some OVR demos. They are in a separate package because they contain the Oculus plugins. You can download them from here (Unity 4) and here (Unity 5).

    Added a game object named "READ ME!" to each demo scene. Click on that game object and you'll see a bit more detailed instructions on how to use the demo and get started with understanding whats going on in the scene:

    There are Comments on some other important game objects as well.

    Added a couple of new demos. "Soccer Kick", "Recoil", "Head Effector"...

    Removed or made unique all assets from Unity's Sample Assets that were conflicting with the package. Goodbye to Ethan and his broken skinning! :)

    Moved all Editor scripts to RootMotion/FinalIK/Editor and RootMotion/Editor folders to make life easier for Javascript users.

    Restructured the InteractionTrigger. Each trigger can now specify the ranges for both character position and camera position for triggering interactions. This is most useful for VR and first person rigs. Unfortunately this will break your existing InteractionTriggers and they have to be set up again. Unfortunately this could not have been avoided. I will update the User Manual ASAP.

    See the release notes for a more detailed list.

    Best Regards,
    Pärtel
     
    WendelinReich and ThunderTruck like this.
  35. frankmat

    frankmat

    Joined:
    Sep 14, 2013
    Posts:
    42
    Fantastic timing!! Just re-started my project again last week.... and was just getting to the part which ironically is a character kicking a football. Your new demo is going to come in very handy!!!

    I've done the import and everything went well! Nothing seems to have broken apart from this warning. Looks good thanks :)

    upload_2015-2-25_21-43-30.png
     
  36. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    Partel,
    me again, thank you soooo much for taking your time to help me, i respect it really much. Um, before i look up in the package and stuff, could you tell me if this might be becouse i'm using mecanim and not legacy animation system on my character ? Just checkin', looking the package right away.
     
  37. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    Partel,
    thank you so much, it was just the arguments in your code that wasn't clear to me, i'm sometimes stupid, sorry for being annoying xD Thank you, it works fine now, both aiming and shooting, it's the right result i wanted.
     
    Partel-Lang likes this.
  38. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I've just started working with FinalIK. I'm trying to make an avatar match the pose of the user, as sensed with the Kinect v2, as closely as possible. I'm using the BipedIK at the moment (since I couldn't see that FullBodyBipedIK offered any benefits here, but somebody correct me if I'm wrong on that).

    Matching the positions of the hands and feet is easy enough, but I'm struggling with elbows and knees. The Kinect is very bad at estimated the rotations of the joints, so just setting the Bend Modifier to "target" looks terrible. But it's pretty good at estimating the *positions* of the various body parts, including elbows and knees.

    How do I set (weak) position targets for things like elbows and knees?

    I have a similar question about the head; the user can (and will) tilt their head various ways, often while still looking at the same point (the screen, of course!). How do I make use of the head tilt with FinalIK?
     
  39. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi, Joe!

    If you need to solve the head, I suggest you use the FullBodyBipedIK component, in 0.5 (uploaded a few days ago) I added a script to the package, it's called FBBIKHeadEffector.cs, take a look at the "Head Effector" demo scene for details. I have not had the time to update the User Manual on this yet.

    You can use a bend goal for the elbows and knees in both BipedIK and FullBodyBipedIK. In BipedIK, you should set the Bend Modifier for the limb to "Goal" and then a slot emerges for assigning the "Goal" Transform.
    In FullBodyBipedIK, each limb also has a "Bend Goal" slot and "Bend Goal Weight", which should be > 0.

    Best Regards,
    Pärtel
     
    JoeStrout likes this.
  40. LampRabbit

    LampRabbit

    Joined:
    Jan 31, 2013
    Posts:
    30
    Hi Pärtel,

    Trying to get the playmaker actions to work for FBBIK and running into an issue,

    NullReferenceException: Object reference not set to an instance of an object
    HutongGames.PlayMaker.Actions.FBBIKLimb.UpdateAction () (at Assets/RootMotion/FinalIK/3rdParty Support/Playmaker/FBBIKLimb.cs:164)
    HutongGames.PlayMaker.Actions.IKAction.UpdateActionSafe () (at Assets/RootMotion/FinalIK/3rdParty Support/Playmaker/IKAction.cs:66)
    HutongGames.PlayMaker.Actions.IKAction.OnUpdate () (at Assets/RootMotion/FinalIK/3rdParty Support/Playmaker/IKAction.cs:60)
    HutongGames.PlayMaker.FsmState.OnUpdate ()
    HutongGames.PlayMaker.Fsm.UpdateState (HutongGames.PlayMaker.FsmState state)
    HutongGames.PlayMaker.Fsm.Update ()
    PlayMakerFSM.Update ()

    The FBBIK is on the owner gameObject so it all makes sense. Do the playmaker action still work your end?
     
  41. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    nice update as welcome :)
     
    Partel-Lang likes this.
  42. SkyMageTheWise

    SkyMageTheWise

    Joined:
    Apr 27, 2014
    Posts:
    3
    Partel Lang: Unity Asset Developer of the Year
    I can't thank you enough for your hard work on the 0.5 update, man. I set my IK/OVR integration aside and waited, because I knew yours would be phenomenal, and it is! I don't think anyone in the industry has managed to do a better job than this. Congrats Partel! and THANK YOU :)

    -SkyMage
     
    Partel-Lang likes this.
  43. SkyMageTheWise

    SkyMageTheWise

    Joined:
    Apr 27, 2014
    Posts:
    3
    Partel,

    Have you tried the new HeadEffector component with a character rig made using Blender / Rigify? The rigify armature has a little bit different heirarchy than the sample soldier, and I'm having trouble getting it moving properly.

    It works perfectly with mecanim and your FBBIK component, but when I try setting up the headeffector, I end up with shoulders bent down low (like the joint is rolling forward) while the head remains in the correct position, stretching the neck. Can you suggest a configuration for FBBIK / HeadEffector that would work with my rig? :)
     
  44. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I'm still new to FinalIK, and for the most part it's working fine. But we've noticed some extreme twisting of the shoulder->upper arm joint that I can't seem to figure out.

    There are two (possibly related) effects: the upper arm seems to be positioned lower than it should be, causing an unpleasant-looking dent in the shoulder; and in many positions, the upper arm is rotated all the way around, so that the back of the arm is facing forward. That not only looks weird in itself, but it causes the mesh where the arm joins the body to twist itself thin. Ouch.

    I've checked the muscle definitions on the avatar, and they look good; the "Arm Twist In-Out" range is correctly set, and doesn't allow for such extreme twisting. I've also made sure the character starts in a natural position, with all limbs slightly bent in the correct direction, as recommended in the manual.

    Any idea what I'm doing wrong? And, where do you set joint limits, if FinalIK doesn't honor the limits set on the avatar muscles?
     
  45. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Oh yeah. Great idea. Come on UT. Do something like this.
     
    Partel-Lang and SkyMageTheWise like this.
  46. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi, LampRabbit,
    Yes the Playmaker actions needed some updating, I forgot I even had them :)
    Please download the updated package.

    Hi, can you send me that character model to support@root-motion.com, I'll check that out.

    Hi,
    Its probably because by default the solver is not using the shoulder bones (some characters dont even have them and in most cases they can be avoided for a performance gain). Add the ShoulderRotator.cs script to the same game object that has the FBBIK and see how it does. If it doesn't, send me some screenshots or something so I could take a closer look.

    Cheers,
    Pärtel
     
  47. RFLG

    RFLG

    Joined:
    Feb 7, 2011
    Posts:
    153
    Hi Partel, I'm having a small issue with two procedures on Final IK, and I was wondering if you can help me out.

    Procedure 1: I'm implementing a simple Reach->Grab->Pick Up action. The goal is for the character to pick up the item and hold it on the hand (it's a sword).

    I'm using a tweaked version of the Interaction Object Settings for the "button push" on your Interaction Demo and I have the "Pick Up" checkbox on, I've also set the cylinder "root" object as the "Other Targets Root". For the object to pick up, I'm using a standard unity cylinder primitive with a rigidbody and the targetPivot/Interaction Target GO.

    The movement works perfectly, however the cylinder is getting a weird offset when picked up. Basicaly it gets parented to the character (as intended), but gets positioned behind it, instead than on the hand.

    Although I can implement a workaround for the offset, I would like to know what may be causing it (since it's not supposed to happen) and if there are any circunstances or elements I should check to avoid this from happening? Oh and of course, if you have a solution or pointers you can provide for solving this issue, I'd appreciate it ;)

    Procedure 2: I'm implementing a Reach->Grab->Pull action. The goal is for the character to grab a ragdoll model e pull it towards himself. This is a two-hand grab, so I have two Interaction Targets on the ragdoll.

    The problem I'm having is on the Pull part, I need the ragdoll being pulled towards the character, and I was wondering if this can be achieved using IK or if I'd be better off doing it with physics and joints? One important detail, the ragdoll's position is dynamic, it floats around rotating randomly in all axis. If this can be done with IK, can you provide me a few pointers on how it can be done using Final IK?

    I thank you in advance for the help and I appreciate any pointers you can provide me for solving this :)
     
  48. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,552
    Hi, RFLG,

    Hi, There was a bug with the system that was causing offset in some cases when objects were picked up. It has already been fixed.
    Please import this package (works with Final IK 0.5).

    About Procedure 2, you could do the same kind of interaction as with Procedure 1, but instead of picking up, just pause the interaction. That will fix the hand to the interaction object that I assume is one of the ragdoll's bones. You can then use constraints to move it around and the hand will remain pinned to it until you resume the interaction.

    Cheers,
    Pärtel
     
  49. RFLG

    RFLG

    Joined:
    Feb 7, 2011
    Posts:
    153
    Hi, Partel!

    Thanks for the quick reply and for the help. I will try both the patch you've provided and the constraints idea. I'll report back to let know how it went ;)
     
  50. RFLG

    RFLG

    Joined:
    Feb 7, 2011
    Posts:
    153
    Hi Partel,

    Regarding Procedure 1: I've tried the patch and it works. Now the cylinder is properly parented to the hand and positioned in place. Some rotation issues occur if the target item is spinning, for instance if I add a constant torque on the Z axis, sometimes the item is posed with strange angles on the char's hand .

    Also, I used one of the dummies from your demo for testing and it works perfectly (other than the beforementioned occasional rotation issue). My original model must have a flaw somewhere since the cylinder gets rotated 180º on the X axis after parented to the hand, so whatever the object I'm using, it gets rotated upside down. Any ideas what the issue on my model could be?

    Regarding Procedure 2: I've tried your suggestion and it worked. I ended up adding a ragdoll rig to char #1 (player) and like you said, I placed the interaction object on char #2's root (to be pulled). I can only do the retrieval movement by moving char #2 around, moving char #1 or even controling it's effectors does not do anything (due to the pause state?).

    I was wondering however if this movement could be achieved using something like your offset effector script? Or if controlling char #2 is the most effective way?

    Thanks for the help and for the time so far ;)