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

    GeneraCrios

    Joined:
    Sep 6, 2017
    Posts:
    4
    Hi @Partel-Lang,

    I have been using the plugin for a long time and it's awesome! In have had always problems with AimIk and reload/recoil/change weapon animations. In the past I solve it toggling AimIk off very fast and similar workarounds. The problem is that the new project needs more attention to detail when aiming, like reloading and keeping aim (at least painting the direction approx), different types of reload animations for different weapons (bow, rifle, revolver...) We are doing what you suggest in the docs with:
    Code (CSharp):
    1. void LateUpdate() {
    2.         aimIK.solver.axis = aimIK.solver.transform.InverseTransformDirection(character.forward);
    3. }
    But what about Pole targets?. We need them and can't toggle them off when reloading. I can't find the correct axis to compensate the reload animation.

    [EDIT] To add a bit more of information imagine that the reload animation points the AimTransform of the weapon to all directions during its time (up, down right...).

    Many thanks,
    Cesar
     
    Last edited: Jun 14, 2020
  2. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    Hi, I am using the Interaction System & Look At IK, and whenever an interaction is called, the Look At Weight is set to (and remains at) 0. Should it not revert to it's default weight value once the interaction is complete?
     
  3. JoeyWeidman

    JoeyWeidman

    Joined:
    Dec 30, 2016
    Posts:
    8
    How can I give the Full Body Biped realistic human joint constraints? Do I need to put a limit component on each limb?
     
    Last edited: Jun 15, 2020
  4. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Oh I see.. If you use an avatar mask on the base layer masking out the fingers, then Animator will have nothing for the fingers so it will put them in that cramped default pose. You could create finger animation/poses with the Animation Window, put them on a new layer in Animator and use a mask enabled only for the fingers for that layer.

    Hey,
    You can only have one set of VR devices connected to a computer so if you run a build and an editor, both receive the same movement. To get different movement, you'll have to run it on 2 different computers with a VR device connected to each.

    Hey.
    This should work if you have the pole target above the character:

    Code (CSharp):
    1. aimIK.solver.poleAxis = aimIK.solver.transform.InverseTransformDirection(character.up);
    It would be better to have another LookAtIK or AimIK component for other looking behaviour. The reason is if weight is not set to 0, it would snap to the next position within a frame and also your custom look-at code could conflict with the way IS is managing it's LookAtIK component.

    Hey,
    FBBIK doesn't work with rotation limits, it has it's own set of internal constraints for the elbows/knees to constrain them to 1DOF like a hinge joint. It would be possible to add RotationLimits to the bones, but they can be only solved on top of FBBIK, not used by the solver in the solving process.
    To apply rotation limits after FBBIK, use this script:

    Code (CSharp):
    1. using UnityEngine;
    2. using RootMotion.FinalIK;
    3.  
    4. public class ApplyRotationLimits : MonoBehaviour {
    5.  
    6.     public FullBodyBipedIK ik;
    7.     public RotationLimit[] limits;
    8.  
    9.     private void Start()
    10.     {
    11.         foreach (RotationLimit limit in limits)
    12.         {
    13.             limit.enabled = false;
    14.         }
    15.  
    16.         ik.solver.OnPostUpdate += AfterFBBIK;
    17.     }
    18.  
    19.     void AfterFBBIK()
    20.     {
    21.         foreach (RotationLimit limit in limits)
    22.         {
    23.             limit.Apply();
    24.         }
    25.     }
    26. }
    Best,
    Pärtel
     
  5. GeneraCrios

    GeneraCrios

    Joined:
    Sep 6, 2017
    Posts:
    4
    Many thanks! The problem us that I don't have the pole transform on top of the character because we need to change the pole position based on the equipped weapon, for example a bow. Take a look at the attached images. The aiming pose is not straight, so that's why I need to offset the pole target. How can I compensate that offset?
    Many thanks
    AimIk AimTransform.png AimiK General pose.png AimIk pole postion.png
     
  6. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    So I need a second LookAtIK component for the same character? Do I have that right?
    Also, what is the Lerp Speed and Weight Speed for Look At for on the Interaction System component? Is it only the speed for setting the Look at weight to 0 when Interaction is used?
     
  7. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,560
    FinalIK is working really well and its very flexible. Im using it for my animals and characters - thank you for making it. I just have one issue. Im adding animals to Wilderless and sometimes my quadrupeds on certain angles of terrain suddenly tilt upwards like in the attached image. Usually running or moving forward a bit and they snap back down. Im wondering if anyone has seen this before and if there is fix, like I am guessing maybe it has to do with the layer detection, could I be detecting something that is getting in the way? Do I maybe need to increase some ind of detection distance? And/or can I limit it so these extreme rotations don't happen?


    Screen Shot 2020-06-17 at 5.13.10 PM.png
     
  8. Volkerku

    Volkerku

    Joined:
    Nov 23, 2016
    Posts:
    114
    FBBIK, set rotation and position weight in script?

    Sorry I'm a beginner here, and would like to set FBBIK Effectors target weights in script.
    What I got so far is not working (... 'FullBodyBipedIK' does not contain a definition for 'LeftLeg' ...)

    this a script excerpt:

    public FullBodyBipedIK _FBBIK;

    _FBBIK.LeftLeg.PositionWeight = 1f;
    _FBBIK.LeftLeg.RotationWeight = 1f;
     
  9. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Please try this script:

    Code (CSharp):
    1. public Vector3 animatedAimDirection = Vector3.forward;
    2.     [Range(-90f, 90f)] public float poleAngle;
    3.  
    4.     private AimIK ik;
    5.  
    6.     private void Start()
    7.     {
    8.         ik = GetComponent<AimIK>();
    9.  
    10.         ik.solver.poleTarget = null; // No need for a pole target transform, we are setting polePosition by script below
    11.         ik.solver.poleWeight = 1f;
    12.     }
    13.  
    14.     private void LateUpdate()
    15.     {
    16.         // Lock pole position, we only tweak pole offset using poleAngle
    17.         ik.solver.polePosition = transform.position + Vector3.up * 5f;
    18.        
    19.         ik.solver.axis = ik.solver.transform.InverseTransformVector(transform.rotation * animatedAimDirection);
    20.         ik.solver.poleAxis = ik.solver.transform.InverseTransformVector(transform.rotation * Quaternion.AngleAxis(poleAngle, Vector3.forward) * Vector3.up);
    21.     }
    So you can get rid of the pole target, then just use "poleAngle" to tweak how many degrees of tilt you like exactly.

    Hey,
    Where is the root of the horse on that picture? Sure it follows the terrain vertically? If it's not that, can you send me a package with the horse and the GrounderQuadruped setup you have? Otherwise all I can do is guess a lot.

    Hey,
    ik.solver.leftLegEffector.positionWeight/rotationWeight. More info here.

    Cheers,
    Pärtel
     
    protopop likes this.
  10. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,560
    That you Pärtel. I sent a package with the animal and quadruped setup.

    This is a picture of my horse root - the transform that i put in the Character Root slot of the quadruped script. Maybe is my root too low to the ground? Should it be above it?

    Or did you mean the root of the horses skeleton?

    Screen Shot 2020-06-19 at 12.37.19 PM.png
     
  11. mait76

    mait76

    Joined:
    May 24, 2020
    Posts:
    9
    Hello Partel,

    I've got both PuppetMaster and Final IK and trying to use them with the "Ultimate Character Controller" (UCC) asset from Opsive.

    I've installed the integration asset offered by Opsive and added "Final IK Bridge" and "Full Body Biped IK" components. I followed your tutorials to set up the IK component, and I used the " Biped Ragdoll Creator" on my character.

    My issue is when I use the "Full Body Biped IK" component along with Opsive's character components and play the scene, the character doesn't interact with the camera appropriately. If I control the camera with my mouse to make the character look up or down, he doesn't move his upper part upwards. It's the same thing when looking down (at his feet, for example), the camera moves down, but the character doesn't look downwards.

    On the contrary, when I use the regular "Character IK" component, everything works normally.

    Am I missing something here?

    Another question, is PuppetMaster compatible with the "Ultimate Character Controller" asset by Opsive?
    When I use UCC to set up my character, it adds a Rigid Body component automatically, does this interfere with Biped Ragdoll? If so, what solution do you suggest?

    Thanks.
     
    Last edited: Jun 21, 2020
  12. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    557
    Thank you, that makes sense! Parenting the hip controller to a slightly offset empty and rotating that gave me the results I needed :)
     
  13. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I'm having an issue with VRIK where our characters are up on their toes, while the toes are sunken into the ground.

    upload_2020-6-23_6-25-46.png

    It looks to me like the foot position would be about correct if he would just flatten out his feet. But I can't find any settings on VRIK to tweak that accomplish that.

    And note that the camera rig height is not at fault; if I bring it down, the character squats, but still embeds his toes in the ground:
    upload_2020-6-23_6-27-10.png

    Any idea how to fix this?
     
  14. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    No one? @Partel-Lang, any idea what's going on with the feet here?
     
  15. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    Is there a way i can do that with a preset pose in the model itself? I am terrible at positioning poses, and my modeler made the pose. I tried, yet it makes a weird cramped pose still.
     
  16. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey, sorry for the long wait.
    On that screenshot the root is in the correct position, it must be on the ground level.
    But the question is, will it stay on the ground level when the horse moves around on the terrain?
    If you run up a hill and the root remains where it is vertically, eventually the horse will sink because the root is too far (beyond the value of "Max Step" from the ground. If you don't have a Rigidbody on it, you'll have to use SphereCast to keep the root on the ground level.

    Hey,
    The Final IK Bridge was developed by Opsive guys, so I don't know much about that, sorry.
    PuppetMaster UCC integration is broken for a long time, but we recently picked it up again with Justin and finally managed to figure out the elusive jitter issues. Just a few remaining issues now, hopefully can ship it soon.

    Hey,
    Where is the root of the character, is it exactly on ground level? You should be able to adjust height just by moving the character root vertically. Unless you have foot targets assigned, do you? Also do you have toe bones assigned in References?

    Hey,
    I'm sorry I did not understand what you meant by "preset pose in the model itself". Did you mean you wish to maintain whatever the hands look like in the Editor without animation stuff messing it up? If so, you could go to the Humanoid avatar configuration, click on Left/Right Hand and remove all the bones from there:
    FingerConfiguration.JPG

    Then the Animator will never be able to mess with the fingers.

    Best,
    Pärtel
     
  17. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Regarding the VRIK toes being embedded in the ground:

    Hmm, you're right, the character root was 4 cm below ground level. Something funky going on with the character controller. Moving it up appears to fix it. Thanks for the clue!
     
  18. OmnifariousStudios

    OmnifariousStudios

    Joined:
    Mar 12, 2018
    Posts:
    48
    Hi Partel!

    I bought both your FinalIK and PuppetMaster, and I'm slowly getting the hang of using them. They're amazing, but I'm having some issues figuring out what to do. I'm building a physics-based VR action game, and I'm working on the enemies. Right now each enemy has their Ragdoll, PuppetMaster, PuppetBehaviour, and FallBehaviour set up. And I've been using these scripts:

    Character Controller
    1. User Control AI.cs
    2. Character Puppet.cs
    3. Aim IK.cs (I tried to use Aim Swing.cs as well, but my character won't track the target if this script is active)

    Animation Controller
    1. Character Animation Third Person.cs
    2. Humanoid Third Person Puppet.controller

    So far, my enemies will run to the target and then enter their idle mode in Grounded Directional, but I can't understand your scripts and how you set the Action Index for that animator controller.

    1. How should I make the scripts that control the attack animations and what to do when the characters reach the target? Should I make my own, or use one of the scripts you created?

    2. For tracking targets and movement, is User Control AI the best, or should I go with NavMeshPuppet.cs and Nav Mesh Agent?

    Thank you!
     
  19. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    I think this may be perfect! I will try it and let you know! Thanks so much for your excellent support for your asset, as well as Unity itself!
     
    Partel-Lang likes this.
  20. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    That demo character controller in PuppetMaster is there just to demo the asset, wasn't really designed to be a universal controller for everything, it doesn't have any navigation so not ideal for AI stuff.
    It would be much better to get started with the NavMeshAgent demo, that example has basically just the navigation and will be much easier to add in attacks and stuff. It is important to be able to understand how everything works in your game.

    About AimIK, please check out the "Aim Controller" demo, AimController is a helper tool for AimIK that takes care of all the smooth target switching and interpolation stuff for you.

    Cheers,
    Pärtel
     
    OmnifariousStudios likes this.
  21. OmnifariousStudios

    OmnifariousStudios

    Joined:
    Mar 12, 2018
    Posts:
    48
    Great, thanks so much!
    I'll try the Aim Controller next.

    I developed my own animation flow that's working pretty well for now. But there are times when transitioning between animations causes them to fall. Could this be due to the animations not transitioning smoothly enough and the sudden changes causing the ragdoll to fall?
     
  22. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    475
    Anyone know if it's possible to use VRIK and the Baker tool together as motion capture solution?
     
  23. JoeyWeidman

    JoeyWeidman

    Joined:
    Dec 30, 2016
    Posts:
    8
    Hello,
    How can I set effector targets and bend goals at runtime on a Full Body Biped?
    Thanks!
     
  24. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Yeah, but only if they have recently collided with something on BehaviourPuppet's Collision Layers and pin weights are reduced by the collision. Please try reducing "Pin Weight Threshold" a bit in BehaviourPuppet (under "Losing Balance" header).

    Yes, you can use the Baker to make a recording of a VRIK session. Switch Baker to "Realtime", then click on "Start Baking".

    Hey,

    Code (CSharp):
    1. ik.solver.leftHandEffector.target = someTransform;
    2.  
    3. ik.solver.leftArmChain.bendConstraint.bendGoal = someTransform;
    More info here and here.

    Cheers,
    Pärtel
     
    Shizola likes this.
  25. JoeyWeidman

    JoeyWeidman

    Joined:
    Dec 30, 2016
    Posts:
    8
    Hi Pärtel,
    I have a couple questions.

    1.) Is there a way to make it so effectors are not pulled by other effectors? In other words, can I make effectors' positions get locked until explicitly moved?

    2.) I have a scenario where I want to: Disable a Full Body Biped -> Change the rotation of the hands or feet -> Re-enable the Full Body Biped. The problem is that when I re-enable the FBB, the rotation changes of the hands/feet are reset. Any suggestions?

    Thanks!
     
  26. SSSekhon

    SSSekhon

    Joined:
    Jun 3, 2016
    Posts:
    11
    Thank you for your help Partel.
     
    Partel-Lang likes this.
  27. Partel-Lang

    Partel-Lang

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

    1) Effector positions will not move unless you explicity move them, but moving the hand target away from the body might still pull the shoulder along, even if shoulder effector is weighed in. If you set "Pull" to 0 for the arm, that won't happen.
    Can also set Iterations to 0 to disable full body solving, but that would make shoulder and thigh effectors useless.

    2) You could approach it differently. Make it like a modifier stack. I mean you could add a FK modifier on top of FBBIK.
    By FK modifier I mean rotation offset for a bone. Something like this:

    Code (CSharp):
    1. [System.Serializable]
    2.     public class FKModifier
    3.     {
    4.         public Transform bone;
    5.         public Vector3 rotationOffset;
    6.  
    7.         public void Apply()
    8.         {
    9.             bone.localRotation *= Quaternion.Euler(rotationOffset);
    10.         }
    11.     }
    12.  
    13.     public FullBodyBipedIK ik;
    14.     public FKModifier[] fkModifiers;
    15.  
    16.     private void Start()
    17.     {
    18.         ik.enabled = false;
    19.     }
    20.  
    21.     private void Update()
    22.     {
    23.         if (ik.fixTransforms) ik.solver.FixTransforms();
    24.     }
    25.  
    26.     private void LateUpdate()
    27.     {
    28.         ik.solver.Update();
    29.         foreach (FKModifier m in fkModifiers) m.Apply();
    30.     }
    So you could just keep FBBIK enabled and change rotation offset of hands, feet or head or whatever at any time.

    If you making some kind of posing tool with FBBIK, then This demo package might help too.
     
    MostHated likes this.
  28. alex_1302

    alex_1302

    Joined:
    Aug 20, 2019
    Posts:
    54
    Hi Partel. I am using Grounder IK (with limb ik) in a two legs character (the player), is working very well, but i was thinking that is a good idea use it to play foot steps sound. So my question is: how can i get know when Grounder IK (or limb IK) know when a feet begins to touch the ground ? are there some event, property or whatever to help me ?. I hope you have a nice day and thanks in advance.
     
  29. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    Hey @Partel-Lang! Thanks to your support, my game has been progressing moderately well. I'm stuck on a very strange issue however. Whenever I rotate the controllers over more than a bit left or right, the arms start getting very weird. Any idea what's causing it? My modeler has no clue. I tried using Twist Relaxers to no avail.

    https://imgur.com/a/6BYYJ7G
    https://imgur.com/a/SW6WXWG
     
  30. MaPiDev

    MaPiDev

    Joined:
    Aug 29, 2018
    Posts:
    21
    Hey @Partel-Lang. I am having a problem using AimIK. The weapon I want to aim is a bow. Reloading the bow rotates and moves it in all kinds of directions which messes up the aiming animation. I am using the "Use Animated Aim Direction" of the Aim Controller to avoid this.

    The animation setup is as follows:
    I have 2 layers in the animator. The "default" layer contains a walk animation, the "upper body" layer contains the shoot animation and uses an avatar mask for the upper body.

    The Problem:
    The root rotation of the walk animation is affecting the aim animation when using "Use Animated Aim Direction". Which means the bow/upper body is not locked to the aim target. It has a left-right sway based on the walk. I know it is the root rotation of the walking animation because I tried to override it with the avatar mask (the green circle on the ground) and the sway was gone. But doing this messes up the whole animation. I looked at all your documentation but could not find a solution. I thought about removing the sway from the animation directly but that feels more like a hack and may also result in a very poor looking animation.

    In this screenshot, I have activated "Animated Aim Direction". As you can see, the character is not aiming at the target but to the left of it because of the rotation of the walk animation.
    upload_2020-7-13_21-11-21.png

    EDIT
    Here is a video showing more of the problem
     
    Last edited: Jul 14, 2020
  31. NewMagic-Studio

    NewMagic-Studio

    Joined:
    Feb 25, 2015
    Posts:
    454
    There is a way to make head of a character to go to a certain point? I have sent you a couple of mails. I had also problems with arms being stiff though lately doesnt happen me anymore
     
  32. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,487
    Hi Partel,
    Could I ask for some advice, I want to add FullBodyBipedIK but only at runtime, I seem to get some null ref type message at runtime, also I want to use ik.solver.leftHandEffector.target afterwards. Is there a code e.g. or video I can watch to see how this can be implemented?
    The aim is to only have these on NPCs when they are close to the player, when far they are removed.
    Thanks in advance.
     
  33. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    GrounderIK doesn't actually know if the feet are planted or not. All it does is add vertical offset to the feet. You could use animation events to add footstep sounds. Go to the import settings of your locomotion animations and add events to wherever the feet touch the ground. Then add a script to the Animator's gameobject that listenes to those events (has a public function with the same name as the events you add) and plays the footstep sounds whenever it gets called.

    Hey,
    Looks like a really weird skinning issue. If you can send me that model fbx, I'll take a look.

    Hey,
    Yeah, Humanoid avatar masks are not great for mixing locomotion with upper body animations. Legacy animation used to be much better at that, you were able to define blend weights for each bone independently, but humanoid AvatarMask is just a stupid boolean mask for the entire upper body.

    You could use the Baker and AimIK to create another set of locomotion animations with the bow aiming baked in just like in this video.

    Another option would be to disable Use Animated Aim Direction in AimController and make a script that uses a fixed axis only while you are aiming the bow:

    Code (CSharp):
    1. public AimIK ik;
    2. public Vector3 animatedAimDir;
    3. [Range (0f, 1f)] public float fixedAimWeight;
    4.  
    5. void LateUpdate() {
    6.   Vector3 fixedAxis = Vector3.forward;
    7.   Vector3 animatedAxis = ik.solver.transform.InverseTransformVector(character.rotation * animatedAimDir);
    8.    ik.solver.axis = Vector3.Slerp(animatedAxis, fixedAxis, fixedAimWeight);
    9. }
    With that script you would be able to blend between fixed aim axis and animated aim axis using fixedAimWeight, something like this:

    Code (CSharp):
    1. bool isAiming = // use AnimatorStateInfo.IsName or IsTag to see if currently playing bow aiming animation.
    2.  
    3. float fixedAimWeightTarget = isAiming? 1f: 0f;
    4. fixedAimWeight = Mathf.MoveTowards(fixedAimWeight, fixedAimWeightTarget, Time.deltaTime * blendSpeed); // Use SmoothDamp for smoother blending
    Hey,
    You could do that with VRIK. Set head position/rotation weight to 1 and all other weights (hand pos/rot weight, locomotion weight) to 0. Assign a head target and it should work.

    Hey,
    Please check out the Adding FullBodyBipedIK in runtime paragraph in the FBBIK user manual page.
    But don't destroy/add FBBIK based on NPC distance. You can just enable/disable the FBBIK component or set ik.solver.IKPositionWeight to 0/1. FBBIK samples the pose when it initiates so when you add it at a random time when the character is in some random animated pose, you'll get different or messed up IK results every time. Also there is some performance overhead/GC alloc to adding and initiating FBBIK, that can be avoided by just switching ik.enabled.

    Cheers,
    Pärtel
     
  34. MaPiDev

    MaPiDev

    Joined:
    Aug 29, 2018
    Posts:
    21
    Thanks for the reply
    I thought about doing this. In fact I already tried it and for the aiming, this works just perfect. But this becomes tricky when having to deal with animations that are not "static". E.g. with the aim animation, the upper body is always in the same pose. But what if I have for example a "draw arrow" animation. I would have to bake one for all the 8 directional movements + idle. Thats not the problem. But how would I blend between them so that it is smooth. For example I have a blend tree and it is currently playing the "walking forward draw arrow" animation. No the character moves right and the blend tree switches to the "walking right draw arrow" animation. But this would start the whole animation over. I guess I would have to create custom animation blending that uses the blends based on the current frame of the animation or something like that.
     
  35. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    Thanks so much! Here's where you can download it: https://ufile.io/vxrmy4hh
     
  36. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Did you already try the other solution I described in my last post? I think that might be easier.

    Hey, thanks for that. Looks like the forearms are mapped to the wrist bones. So when you twist the wrist, it twists the entire forearm. Will be better if you used hand_l and hand_r (children of wrists) in VRIK's References instead.

    Best,
    Pärtel
     
  37. CompuGeniusPrograms

    CompuGeniusPrograms

    Joined:
    Aug 27, 2018
    Posts:
    41
    OMG you're a lifesaver! I would never have thought of that! Thanks so much!
     
    Partel-Lang likes this.
  38. MaPiDev

    MaPiDev

    Joined:
    Aug 29, 2018
    Posts:
    21
    Hey @Partel-Lang. I found a solution. To make it short, I basically manually edited the walking animations to use the same pelvis rotation/position. Then I used Baker to create the upper body animations. This worked like a charm with my manually stabilized pelvis. Thanks for your support.
     
    Partel-Lang likes this.
  39. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    Sorry if this is answered somewhere here. I've tried searching this thread, but didn't find the answer yet.

    Does this asset support previewing the modifications within the editor, instead of needing to enter play mode? I'm trying to use this in conjunction with Slate, and so far I haven't figured out how to preview things without entering play mode.
     
  40. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    I haven't tried Slate myself, but FIK components can be updated in editor. There is the EditorIK script in the package for that. But get this patch first, there have been some fixes and improvements to it.

    Best,
    Pärtel
     
    dgoyette likes this.
  41. mutp

    mutp

    Joined:
    Oct 1, 2018
    Posts:
    79
    In order to detect footsteps on ground, do you recommend I implement raycasts from each foot and play a sound on impact? Or does one of the FinalIK components implement this already?
    Also, I can't use events defined in the animation because I need to play different sounds depending on the surface being run on.
     
  42. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    Is there any documentation on how the Editor IK script should be used? I installed the updated version you link. I've tried adding Editor IK to the same model on which I have the Final IK components, and wiring up its Animator property..

    upload_2020-7-24_2-7-59.png

    I then pressed "Preview" to view run an animation clip on this model, but none of the Final IK stuff works in Edit model.

    upload_2020-7-24_2-9-27.png

    It works fine once I'm in play mode, but nothing previews in the editor. Debugging the code, it seems this line always causes the Update to return:

    Code (CSharp):
    1. if (!ik.GetIKSolver().executedInEditor) return;
    It never gets past that point. Is there something I need to configure differently to get Editor IK to evaluate and solve the IK constraints?
     
  43. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    The Grounder does raycasts, you can access a leg RaycastHit by:
    Code (CSharp):
    1. grounder.solver.legs[0].GetHitPoint()
    If using GrounderFBBIK, then keg index 0 is left leg, 1 is right.

    But you can use animation events together with that raycast information. Get timing from the animation events and hit material information from the Grounder raycast,

    Hey,
    1. Add an IK component to the character (you probably already have that)
    2. Add EditorIK to the same gameobject
    3. Create/Final IK/EditorIK Pose
    4. Assign the created pose as "Default Pose" in EditorIK
    5. Click on the "Store Default Pose" button in EditorIK (only appears when default pose is assigned)
    6. Click on the "Start Solver" button.

    That should get the solver running for you in the editor.

    Cheers,
    Pärtel
     
    dgoyette and mutp like this.
  44. msmsm

    msmsm

    Joined:
    Feb 1, 2014
    Posts:
    49
    Hi,

    I am trying to achieve the following:

    I have a sword swinging animation, left to right, that actually consists of two animations; a prepare for swing and a swing. I want to 'angle' this animation for different attacks. I could create several animations and blend them but I thought I would give finalIK a go.

    I think there are two ways of achieving this;

    aimIK with different aim positions for the prepare and swing, so a left-upper would have the prepare at bottom right and the final at top-left

    FBBIK using effectors on the hand.

    I am to delve into these in more detail when the time allows but thought I would ask if anyone has tried something similar and had any pointers first.

    Thanks,

    Matt
     
  45. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey,
    Angling sword swings is pretty easy with AimIK, please take a look at the "Aim Swing" demo.
     
  46. msmsm

    msmsm

    Joined:
    Feb 1, 2014
    Posts:
    49
    Ok, will follow that through first and see the results. I have watched it before, and I wasn't sure it would allow me to get the angled swings (hight to low), but I will give it a try!
     
  47. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    Great. That works. Thank you.

    Now, however, I'm running into an issue I don't understand. Is this Editor IK not compatible with choosing clips in the Animation window and recording keyframe for IK effector targets? It seems that while the Editor IK solver is active, I'm locked to one particular animation clip in my animator.

    For example, here's my Full Body IK:

    upload_2020-7-24_13-8-59.png

    My expectation is that I should be able to record keyframes, changing "ABC's" position and rotation, and have the solver follow that. However, whenever the Editor IK solver is active, it seems that it just plays whatever the Animator's default clip is, and I'm unable to record keyframes while the solver is active.

    Am I missing something simple here? Should I be able to record keyframes for the effector target while the preview is running? Should I be able to scrub through the animation clip to arbitary frames? (Is there maybe a video or a documentation page on this I haven't found yet?)
     
  48. fengkan

    fengkan

    Joined:
    Jul 10, 2018
    Posts:
    82
  49. msmsm

    msmsm

    Joined:
    Feb 1, 2014
    Posts:
    49
    I have tried several bits with aim IK and FullBodyIK and think my problem is solveable, just not sure how. What i want to achieve is the following.

    I have an animation, which is drawing the sword back and swinging. This is a straight left to right. What I want is to be able to effectively rotate this animation, so go from bottom left to top right for example, with minimal change to the animation. I have tried the aim offset approach, with a start and end offset, but i'm not sure this is the correct approach. What I really want is to offset the animation on the windup so the hands end up at position x + y, rather than x, and then offset the swing so the end of the swing ends at x -y (for example). I feel it is gettable, just loosing my way somewhat. Any help would be great. For what it is worth, I am trying to create something like chivalry or mordhau, with the angle of the sword dictated by the mouse position, but trying to make it based off a single swing animation I have.
     
  50. gliealonso

    gliealonso

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

    How can I make props with PuppetMasterPropMelee script appear heavy? Le'ts say I grab a huge axe with my character that has VRIK setup, and I want to be able to dictate how fast I can move the axe. I tried decreasing the character puppet pinweight and etc, but that did not work, and I also tried increasing the mass of the prop with no results.

    Many thanks,
    Gabriel.