Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Oh, sorry!
    I just tried to do that, added an EffectorOffset to the "First Person Shooter" scene. If you move the body down, you'll have to move both left hand and right hand down the exact same amount, then it'll work.
    Screen Shot 2016-07-19 at 10.32.28.png
     
    funderburk5 likes this.
  2. PatrickKa

    PatrickKa

    Joined:
    Apr 30, 2014
    Posts:
    245
    I just bought this asset for usage in Virtual Reality but it does not work at all. I really thought it would be a huge time safer but it seems it is not as simple or the examples are not optimal/broken.

    There are outdated Oculus examples that are missing scripts. I also tried the Head Effector Demo scene but I'm floating in the air and it does not even use SteamVR. I added it myself and I also did place the anchors according to the controller but it still is a mess. I'm floating or I'm doing limbo and everything is rotated absolutely wrong and all stuff like that.

    This is a huge disappointment. I thought it would be maybe 15 minutes to set it all up. I'm not intersted in spending hours in trial and error.

    All I want is IK like the other games in VR do. Track the controllers, track the head. If the player moves to another position the body should follow and should not start doing limbo or whatever......

    As this asset surely is getting more attention since VR this should work out of the box...
     
  3. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi,

    I am well aware of the difficulties with setting up IK for VR at the moment. The FullBodyBipedIK component didn't originally have a head effector so that works with a hacky solution of an add-on script. Which is why I am in the process of developing a new full body solver dedicated to VR. Don't have an ETA for you yet, it has grown much bigger than I initially planned. I'm currently implementing and testing it in Dead and Buried and it will be added to Final-IK.

    I'm not sure what you expected, but moving the body to another position is not a job for IK anymore, that is a job for a character controller and animation.

    I hate to see you disappointed though, so please just PM your invoice number and I'll refund it or send me the character you want to use and I'll help you set it up.

    Cheers,
    Pärtel
     
  4. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,168
    Hello. I really love this asset and I have looked at the demo Scene named Third Person Shooter. I really love that and I've tried to set it up for my custom character but I can't get it to work. How was it set up and how can I set it up for my custom character?
     
  5. PatrickKa

    PatrickKa

    Joined:
    Apr 30, 2014
    Posts:
    245
    Hey,

    thank you very much for your kind words and your offer.

    Do you have access to an HTC Vive? A correctly working demo head effector demo scene using SteamVR and the character already in it would be fine for me. I just cannot make it work together myself or the result is quiet bad.

    Thank you!
     
  6. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi and thanks!

    Just tried setting up the Pilot in that demo scene. I just:

    1. Dragged the Pilot into the scene.
    2. Added the same IK components as the Dummy has, made the parameters in AimIK look the same.
    3. Copied over the rest of the components (CharacterController3rdPerson.cs, AnimatorController3rdPersonIK.cs).
    4. Moved the CameraTarget gameobject over from the Dummy, parented it to the Pilot.

    ...and it worked. You'll have to keep in mind to set the "Axis" of AimIK to whatever axis of the "Aim Transform" that is pointing forward.

    Hopefully I'll get a Vive in a couple of weeks when a friend comes to visit from Denmark, unfortunately they don't ship to my country. When I get the device, I'll be sure to revisit all those demos and add SteamVR samples.

    The problem might be with the different bone orientations of your character. The targets you assign to IK must not be the HMD/hand controller anchors, but gameobjects parented to them that have same orientations as the bones of the character. So for instance, instead of assigning FBBIKHeadEffector to the CenterEyeAnchor (in Oculus language, not sure what it is called in the Vive setup) directly, move the CenterEyeAnchor to the eyes of the character, make a duplicate of the character's head bone and parent it to the CenterEyeAnchor. Use that head bone duplicate as the head effector instead, it has the same orientation as your character's head.
    The same goes for the hands.

    Btw, which scene and gameobject did you get a missing script warning from?

    Regards,
    Pärtel
     
  7. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,168
    Got it to work. Now I just have two issues. So I tried adding the recoil script to my scene and whats happenign now is that its getting pulled backwards rather than getting rotated to Point upwards like the demo. I copied over all the values and everything. Also, my head is for some reason looking straight backwards towards the camera.
    Any solutions?
     
  8. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey,
    I have updated the AnimatorController3rdPersonIK script to support Recoil.
    Please download this package, it also includes a demo scene with that set up.
    About the head, not sure what goes wrong with that character you have, but you can comment out line 40 in that same script that says:

    Code (CSharp):
    1. headLookAxis = ik.references.head.InverseTransformVector(ik.references.root.forward);
    and add a
    Code (CSharp):
    1. public Vector3 headLookAxis;
    to declaration space. Then you can specify in the Editor which axis of the head should look towards the aiming direction.

    Cheers,
    Pärtel
     
  9. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,168
    After simply downloading the new script you sent me and just adding it I got 4 errors. Idk if its because my whole Final IK is of an older version.
    1:
    Assets/Plugins/RootMotion/FinalIK/_DEMOS/FBBIK/Scripts/AnimatorController3rdPersonIK.cs(87,52): error CS1061: Type `RootMotion.FinalIK.Recoil' does not contain a definition for `SetHandRotations' and no extension method `SetHandRotations' of type `RootMotion.FinalIK.Recoil' could be found (are you missing a using directive or an assembly reference?)
    2:
    Assets/Plugins/RootMotion/FinalIK/_DEMOS/FBBIK/Scripts/AnimatorController3rdPersonIK.cs(94,75): error CS1061: Type `RootMotion.FinalIK.Recoil' does not contain a definition for `rotationOffset' and no extension method `rotationOffset' of type `RootMotion.FinalIK.Recoil' could be found (are you missing a using directive or an assembly reference?)
    3:
    Assets/Plugins/RootMotion/FinalIK/_DEMOS/FBBIK/Scripts/AnimatorController3rdPersonIK.cs(95,74): error CS1061: Type `RootMotion.FinalIK.Recoil' does not contain a definition for `rotationOffset' and no extension method `rotationOffset' of type `RootMotion.FinalIK.Recoil' could be found (are you missing a using directive or an assembly reference?)

    4:
    Assets/Plugins/RootMotion/FinalIK/_DEMOS/FBBIK/Scripts/AnimatorController3rdPersonIK.cs(105,63): error CS1061: Type `RootMotion.FinalIK.Recoil' does not contain a definition for `rotationOffset' and no extension method `rotationOffset' of type `RootMotion.FinalIK.Recoil' could be found (are you missing a using directive or an assembly reference?)



    Any clues?
     
  10. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    Hi, I need to scale my character 10 times lager than normal, there will be any problem I'll encounter? Can this be possible? thanks.
     
  11. Partel-Lang

    Partel-Lang

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

    Yes, you need the latest version for it to work. Or try downloading this Recoil script from the latest version first.

    Hi, uniform scaling is supported, no problem. Non-uniform scaling is not.

    Cheers,
    Pärtel
     
    TwoTen and ksam2 like this.
  12. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,168
    Thank you alot for providing a download link. It's a pain in the ass to use the Unity Update system sometimes. Keep up the amazing work!
     
    Partel-Lang likes this.
  13. copperrobot

    copperrobot

    Joined:
    May 22, 2013
    Posts:
    68
    Hi there, I'm having an issue with the hand effector. It appears to be 'offset' from the intended target. This is using a Vive style setup.

    http://i.imgur.com/lCP2xNX.png

    The above shows two avatars, my own (with the metal hand) and the Final IK dummy. They both are using the same settings throughout. They both have the same hand effector. Yet my own setup appears to be 'offset' from it's effector. Is there a reason this might happen or a solution for it?

    As a note: The same thing happens on the pilot when I tried that.

    Edit: It's rotation point is offset strangely. You can see in the above image that the effector appears to be in the correct location (overlaid over the Dummy hand), yet when I rotate the point it rotates AT the wrist of my avatar. So the rotation is at the correct point, but not the position. It leads to the hand wandering 'around' the correct location, but never at it, no matter how much I move the effector.

    I've attempted to use the effector offset script, but it doesn't appear to work when there's a target already involved, and I suspect that it would not solve the issue.
     
    Last edited: Jul 28, 2016
  14. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey,

    Can you move the hand target (parented to the hand anchor) local position to fix that? You'd probably want to adjust that to fit the controllers properly in the hand anyway.
     
  15. CrazeDevelopment

    CrazeDevelopment

    Joined:
    Nov 26, 2010
    Posts:
    22
    Hey Partel,

    Huge fan of your work and your plugin, I use it all over the place, incredibly flexible. I will pretty much buy anything you write, your code's structural quality is pretty unparalleled on the asset store.

    I am noticing that there is a discussion of VR here; I am currently using the LimbIK component for player arms and setting the bend target below the Vive controllers. It works really well, though some occasional glitches.

    My question is: Can I add constraints to the LimbIK solver? I will happily write any needed code to do so, I am just not sure where to start. I figured I would ask the master himself!

    All the best,
    Oliver
     
  16. copperrobot

    copperrobot

    Joined:
    May 22, 2013
    Posts:
    68

    I've moved them to fit the hand, but what it appears to be is that the POSITION is offset - it's slightly to one side as in the image, but the ROTATION is correct - so it rotates at IT'S wrist, rather than 'parented' to the effector.

    I noticed that if I switch off the head effector for the pilot it fixes it, but not for my own avatar.

    EDIT: Here's a demonstration with just hand effector: http://i.imgur.com/AYRFM6y.gifv

    EDIT 2: Okay, so it seems like it was something to do with the bones setup. I re-rigged it and it works fine now.
     
    Last edited: Jul 29, 2016
  17. tauceti38

    tauceti38

    Joined:
    Sep 20, 2013
    Posts:
    15
    Hi Partel,

    I'm trying to pose a character's hand resting along a chair's arm using the interaction system, but I'm getting an issue where the finger bones are twisting/distorting. This is part of a virtual reality project using the HTC Vive. I'm using characters generated by UMA, and applying all the pieces of Final IK at runtime based on several instructions from you I've found online. In total, I'm adding the FBBIK script, the Head Effector script, the Interaction System script, and the Hand Poser scripts at runtime. The character's other hand is going to be posed holding an HTC Vive controller. For some reason that interaction element is no longer being triggered by my script (but that's another problem I'll worry about later, I most likely broke something when I set up the other hand). When it was working, it exhibited the same (or similar) twisting of the finger bones.

    I've attached an image below.

    Interaction - finger bones twisted.png

    I've made a copy of the hand, posed it like I want it to be, then assigned the Interaction Target and Interaction Object to it (see image from the inspect below, the peak of all of the curves is at 0.5). All three of the weight values in the hand poser script are set to 1.0.
    Interaction - hand settings.jpg

    The interaction is being triggered in code using the following command, which is placed in an update function, where LeftHandRestingPosition is the game object containing the interaction target for the hand.
    Code (csharp):
    1. if (!leftHandInteractionStarted)
    2. {
    3.     leftHandInteractionStarted = interactionSystem.StartInteraction(FullBodyBipedEffector.LeftHand, LeftHandRestingPosition, true);
    4. }
    Do you have any suggestions? I'm not sure what else to try to fix issues with finger bones. The bones are lined up correctly with the interaction target, their just twisted.

    Thanks!
    Andrew
     
  18. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey, thank you so much for the kind words, it means a lot!
    LimbIK itself can't be constrained, but you can apply rotation limits once LimbIK has solved. To do that, add rotation limit components to the bones, then make a script that disables them and updates them after LimbIK is done (add your script to a higher value in the Script Execution Order than LimbIK).

    Code (CSharp):
    1. public RotationLimit[] rotationLimits;
    2.  
    3.     void Start() {
    4.         foreach (RotationLimit limit in rotationLimits) limit.Disable();
    5.     }
    6.  
    7.     void LateUpdate() {
    8.         foreach (RotationLimit limit in rotationLimits) limit.Apply();
    9.     }
    Hey, it's actually the HandPoser.cs that is in charge of rotating the fingers. It does so by simply going through the bone hierarchy and rotating each bone to match its counterpart in the target hierarchy. Maybe the hierarchy has changed since you duplicated it, like maybe there is a prop parented to the hand or something? It is not a very reliable method and I plan to rewrite it. In the meanwhile, try replacing HandPoser components on your characters hands with GenericPoser.cs and see if that helps.

    Cheers,
    Pärtel
     
  19. tauceti38

    tauceti38

    Joined:
    Sep 20, 2013
    Posts:
    15
    Using GenericPoser appears to have fixed the problem! Thanks so much.
     
  20. RecklessGames_

    RecklessGames_

    Joined:
    Jul 30, 2010
    Posts:
    222
    First want to say this is a great plugin. I'm having a minor issue with my walking animation when going up a slope. The knees bend inward when going up a slope. I'm sure this is user error somehow but couldn't seem to find the settings needed to reduce or remove the conflict. And was unable to find a posted issues that was similar. If you could give me any insight to a fix that would be greatly appreciated.

    Thanks,
    Steven M.
     

    Attached Files:

  21. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi!
    Try rotating the knee bones in the Editor so the little blue arrows on the knees point more outwards in the Scene View when you have the FBBIK gameobject selected.

    Cheers,
    Pärtel
     
    RecklessGames_ likes this.
  22. wirelessdreamer

    wirelessdreamer

    Joined:
    Apr 13, 2016
    Posts:
    134
    I jsut upgraded to unity 5.4, and i'm having trouble with the head effector script. I used to be able able to get my character to bend at the knees when I crouched with my vive controller. I've just finished resetting up my character with the openvr integration in 5.4, and they no longer are bending at the knees. do any of these settings look off?

    I tried setting the legs and abs as streach bones as well, because the character currently looks like a giraffe, but that didn't affect anything either.

     
  23. Jackrabbit82

    Jackrabbit82

    Joined:
    Mar 13, 2013
    Posts:
    16
    Hello sir ! Really awesome package and solution for everything IK related !
    I've been investigating a strange issue tho, the full body IK on my character seems to be causing a strange hickup or glitch at random moments. It looks as a skinning issue as if the skin would stop updating on the legs only for a frame. But after investigating a lot, if a turn off the full body IK this is fine. Anyone else experienced issue like that ??

    I've created a straight biped with a place holder box character, and none of the glitches seems present so i know it's probably in my previous biped character setup. but still i'm running out of ideas as to what can be causing this kind of "skin" refresh issue when keeping IK.

    EDIT: I found the problem ! really sorry i've set the pelvis as root node instead of the spine1 in my biped Sorry for that post ! :p I feared it was maybe my stretch and squash but nope everything is fine ! Best package ever !
     
    Last edited: Aug 5, 2016
  24. dhuang

    dhuang

    Joined:
    Jan 5, 2016
    Posts:
    40
    I downloaded your Final IK two days ago and had been playing around with it to sync up with Vive. I've setup the Hand effector with ik.solver, and I create a gameObject with the headEffector to control the head.

    However, when I am running the game, it seems like the hands are constantly causing more pull than the head. The hands seem to track the controller pretty closely. The head, however, always get pull down lower than the HMD (where my eyes are) when I lower my hands to the side of my laps. sometimes the head would be more than 1 foot below the HMD.

    I've tried adjusting the weight of the effector, but it's not getting me the effect I wanted. So I thought I would write you to ask for help.

    Previously before I downloaded final IK i had used Unity's IK solution and was able to get the head mapped correctly onto the VR with the Lookat IK, but it was not able to match the rotation of HMD to the head. so I started exploring with Final IK, which has much more realistic movements. However it seems like I am stuck on something that I cannot quite figure out. I tried to search through the forum but didn't quite find the fix for it.
     
  25. RecklessGames_

    RecklessGames_

    Joined:
    Jul 30, 2010
    Posts:
    222
    Are you talking about the actual bone transform that the FullBodyIk Referneces? Modifying this in the scene view? Wont the animator reset these transforms based on the playing animation in runtime, which is what it appears to be doing as the knee popping persist in play. Perhaps I missunderstand.

    Thanks,
    Steven M.
     

    Attached Files:

  26. wirelessdreamer

    wirelessdreamer

    Joined:
    Apr 13, 2016
    Posts:
    134
    The issue wasn't related to the 5.4 update, I had a leap motion module on too that was affecting the character.
     
  27. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi!
    Since the FBBIK solver doesn't really have a head effector, it is emulated using some custom code and the shoulder effectors. So the hands having priority over the head is kind of a technical limitation of that solution. (its the other way around in VRIK).
    When the arms of the avatar are shorter than your own, either the head or the hands will have to budge. So what you can do improve it is to just stretch the arms longer by multiplying the localPosition of the forearm and hand bones in LateUpdate. You can adjust that multiplier's value based on the distance of the hand controllers from the head.
    Another reason for the hands to not reach the targets without having to pull the head down is that by default the shoulders are stiff. Try adding ShoulderRotator.cs to the FBBIK component (expensive), or just rotate the shoulder bones a bit towards the hand targets in LateUpdate.

    Hey, glad you guys already found the solutions :)

    Yes, FBBIK will sample the pose of the character at Start to know which ways the limbs should be bent, that is before the Animator has applied. Could you send me a video of that knee issue or perhaps the character and that animation in which the popping occurs?

    Cheers,
    Pärtel
     
    RecklessGames_ likes this.
  28. RecklessGames_

    RecklessGames_

    Joined:
    Jul 30, 2010
    Posts:
    222
    Ok Great! I sent you a PM with a link to a downloadable UnityAssetPackage with the test scene setup.

    Thanks for your support,
    Steven M.
     
  29. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Hey Pärtel,

    I have a question regarding the "Recoil/reload animations while aiming" part of the documentation.

    Code (CSharp):
    1. aimIK.solver.axis = aimIK.solver.transform.InverseTransformDirection(character.forward);
    Should this piece of code only getting executed when the recoil/reload animations play? Or all the time?
     
  30. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hi,
    All the time. If you will only start to call it when it reloads, it will pop from one place to another. It will not pop though when you stop calling it, as the axis will just not be changed anymore.

    But you can actually blend it in/out smoothly:
    Code (CSharp):
    1. aimIK.solver.axis = Vector3.Slerp(defaultAxis, aimIK.solver.transform.InverseTransformDirection(character.forward), w);
    I guess I should make a demo scene about that..

    Cheers,
    Pärtel
     
  31. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Hmm, that is strange, because when adding that line of code the behaviour of aim ik is identical as if I'm setting the global weight to zero.

    Code (CSharp):
    1. if(!animator.GetBool("Reloading"))
    2. aimIK.solver.axis=Vector3.left;
    3. else
    4. aimIK.solver.axis=aimIK.solver.transform.InverseTransformDirection(this.transform.forward);
    This works fine so far, except the popping you mentioned.

    p.s. Would it be possible that you make the ik field inside OffsetModifier.cs public in the next update? This is required when adding the Recoil script at runtime.
     
    Last edited: Aug 12, 2016
  32. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Try this script, does it still look like global weight was 0?

    Code (CSharp):
    1. public AimIK ik;
    2.     public Transform characterRoot;
    3.     public Vector3 animatedAimingDirection = Vector3.forward; // The direction of aiming in the animation relative to the rotation of the character.
    4.     [Range(0f, 1f)] public float maintainAnimatedAimDirWeight = 1f; // 0 weight will keep the Aim Transform locked at the target at all times, 1 maintains the animated aiming direction.
    5.  
    6.     private Vector3 defaultAxis;
    7.  
    8.     void Start() {
    9.         // Store the default "Axis" of AimIK
    10.         defaultAxis = ik.solver.axis;
    11.     }
    12.  
    13.     void LateUpdate() {
    14.         ik.solver.axis = Vector3.Slerp(defaultAxis, ik.solver.transform.InverseTransformVector(characterRoot.rotation * animatedAimingDirection), maintainAnimatedAimDirWeight);
    15.     }
     
  33. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Yes, but it depends on the maintainAnimatedAimDirWeight value, when setting the field to 1, it behaves like global weight is 0, setting it to 0 it's the same as setting global weight to 1 which is resulting in buggy ik when the reload animation plays.
     
  34. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    If you adjust animatedAimingDirection in the Editor does it have no effect?
     
  35. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Changing animatedAimingDirection to e.g Vector3.left, makes my character aiming in a different direction.
     
  36. PartyBoat

    PartyBoat

    Joined:
    Oct 21, 2012
    Posts:
    97
    Hey Partel,

    I just bought Final IK today for the purpose of use in a VR game (specifically the Vive). However, it was only after I bought it that I was digging around these forums and realized you already have a VRIK system in the works! :p

    Well anyways, I've decided that it would be a better use of my time to wait for your VR update instead of working on my own system. Before I make any plans though, I was wondering if you could give me a general time-frame for the release of VRIK? Is it days away? Weeks? Months? It would really put my mind to rest if I knew what the rough estimate on the release was. I'll wait before rolling my own system, but I can't wait more than a month or so for various reasons.

    Thanks for the epic asset!
    ~PartyBoat
     
  37. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    That's the idea. If your character is aiming forward in the animation clip, you "normalize" it by that code, telling AimIK that "the gun is already aiming forward, no need to do anything unless the target direction was different". So if you move your target left/right/up/down it will still follow, but instead of keeping it locked, it will work like an offset for the animation. Try moving the target. You may have to fine-tune the animatedAimingDirection in the Editor for accuracy.

    Hey, thanks for the purchase!

    VRIK is long overdue, but I have deadline now, planning to release it by Oculus Connect 3, 5th of October.
    In the meanwhile you can get started with the FBBIK + head effector solution (see the "Head Effector (Hand Controllers" demo scene), migration will be rather easy.

    Best,
    Pärtel
     
  38. PartyBoat

    PartyBoat

    Joined:
    Oct 21, 2012
    Posts:
    97
    Thanks for the quick update! Glad the date is not too far off, although if you say migrating won't be too much of a problem I think I'll take a crack at the FBBIK + head effector solution. Thanks again!
     
  39. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    That's the problem, I'm using this to force the character to aim directly at the crosshair, which works fine except when playing reloading, activating/deactivating, etc. animations. But when I add your snippet (or the one from the documentation) it's the opposite, the reload animation looks good, but when running the run animation influences the aim ik (it's not locked anymore).
     
  40. wirelessdreamer

    wirelessdreamer

    Joined:
    Apr 13, 2016
    Posts:
    134
    I'm getting close to having my SteamVR Vive character rigged and moving nicely. I have a Full Body Biped IK with transforms parented to the hands, and tracking my movements. In need to be able to stretch my arms, instead of the neck (head has fix head checked.) I'm not sure how to go about that though.
     
  41. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    315
    Hi,
    I'm not too sure how to use Look at Ik - it's the only thing I've never really gotten to grips with in Final IK I think. Basically what I'm wanting to do is have my character look at the same object that he is currently using with the Interaction System. I have him picking up objects, pushing buttons etc with Interaction System (and Hand Poser) but he doesn't turn his head to them. Is there something simple I'm missing here? I cannot find any demo scenes or tutorials on Look at Ik.
    Thanks
     
  42. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey,
    OK, then you can blend that weight value to 1 when you need it and back to 0 when you don't based on what the character is doing.

    You can stretch the arms by multiplying the localPositions of the forearm and hand bones in LateUpdate.
    Code (CSharp):
    1. void LateUpdate() {
    2.             ik.references.leftForearm.localPosition *= stretchMlp;
    3.             ik.references.leftHand.localPosition *= stretchMlp;
    4.         }
    StretchMlp could be a fixed value if you just need the arms longer, but you can also link it with the distance of the hand controllers from the HMD.

    Hi!

    Take a look at the "Interaction" demo scene, it has a LookAtIK component on the Dummy. That LookAtIK is also assigned to the InteractionSystem, which means it will automatically look at all the interaction objects.
    Screen Shot 2016-08-15 at 09.56.01.png

    Cheers,
    Pärtel
     
  43. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    315
  44. Morpheus

    Morpheus

    Joined:
    Feb 2, 2014
    Posts:
    13
    Hello, I am trying to use the FBBIK system to pose my character, but when i put my hand target in a certain position, the shoulders start twisting weirdly. This also sometimes happens with the player's waist. Any ideas what I could do to fix it?
     

    Attached Files:

  45. Morpheus

    Morpheus

    Joined:
    Feb 2, 2014
    Posts:
    13
    As a continuation of my previous post, I tried using the Dummy object that was included in demo scenes to ensure the problem was not with my model. In continuing tests, I also found that without changing the target of the right arm, but changing the target of the left, the right arm would rotate back and forth between a good position, and one where the elbow goes through his head as shown in the following screenshots. Please help.
     

    Attached Files:

  46. Morpheus

    Morpheus

    Joined:
    Feb 2, 2014
    Posts:
    13
    @Partel-Lang ?
     
  47. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    That works, thanks.

    Is there any way to make the characters head looking to the same direction he aims at? Or do you suggest to use LookAtIk for that purpose?

    I've tried to add the head to the aimik chain, but I'm always receiving a warning telling me that the order of the provided bones isn't correct.
     
  48. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,548
    Hey, sorry for the delay, I think the forum fails to send notifications sometimes or something.
    Anyway, are you using effector "Rotation Weight"? that might be causing it, so I usually just leave it at 0 and rotate the hand bone directly via code and use Bend Goals if necessary. But if it happens with the waist, it may be just the limitation of the solver, it doesn't handle taking the left hand and pulling it to the far right very well.

    Hey, you could add another AimIK for the head too if you don't want LookAtIK. Just make sure it updates after the main AimIK. Add the IKExecutionOrder.cs component or disable the components and update them manually in LateuUpdate.

    Best,
    Pärtel
     
    silentneedle likes this.
  49. frankmat

    frankmat

    Joined:
    Sep 14, 2013
    Posts:
    42
    Hi Partel,

    Hope you can help me with this. I tried following the example you had with stairs in the Grounder demo but I am having a problem when I get to the top of the stairs and back onto level ground. The character as you can see in the video appears like he is in a falling animation.

    Do you know what it could be that is causing this?

    thanks in advance

    Frank

     
  50. Morpheus

    Morpheus

    Joined:
    Feb 2, 2014
    Posts:
    13

    Hey, I am actually not using rotation weight at all. Do you have any other suggestions?