Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    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. AlbertSwart

    AlbertSwart

    Joined:
    Oct 17, 2015
    Posts:
    15
    Hi Partel,

    I am battling a bit to get a character animation scenario using FinalIK to work properly and was hoping you may have advice / tips for me to help nail it.

    I have a character holding a rifle in a default relaxed pose like so:



    When aiming it needs to transition to the following pose:



    Before aiming I want it to look at the target, which is easily achievable using Look At IK:



    My challenge is to get Aim IK to weigh in during the transition from relaxed pose to aiming pose, so that as the character lifts the rifle it should already 'lerp' towards the target so that when coming to rest in its aim pose the character is aiming directly at the target.

    If I weigh in Aim IK it will not give me the effect I am after since the aim transform is not pointing to the target thus the spine will be bent, as expected.

    You have a demo where you do a 360 aiming system using a direct blend tree, but in this case there are animation nuances (relaxed to aim and aim to relaxed animations) that will get lost if I simply blend between the two static poses.

    Any ideas? :)
     
    Last edited: Apr 6, 2016
  2. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,058
    Hey!
    Are you using some code to tilt the base or is it done by the solver? Have you tried adjusting bone weights?
    Alright, no prob, I'll make a bug report...

    You can play an animation of going from idle to aim and still use AimIK on top of that the whole time. You'll just have to adjust the Axis of AimIK, tell it that whatever pose the character is in, it is aimed forward.
    That's all the code you'll need:

    Code (CSharp):
    1.  
    2. public Vector3 aimDirection = Vector3.forward;
    3. void LateUpdate() {
    4.         aimIK.solver.axis = aimIK.solver.transform.InverseTransformDirection(character.rotation * aimDirection);
    5. }
    That enables you to also play reloading and recoil animations while aiming with AimIK. You might have to adjust aimDirection in the Editor to fix accuracy.

    Cheers,
    Pärtel
     
  3. AlbertSwart

    AlbertSwart

    Joined:
    Oct 17, 2015
    Posts:
    15
    You sir are a gentleman and a scholar! Awesome.

    There is one artifact to using only this code though. When the target sits above or below the character the spine gets bent into an unnatural pose when idle:
    (No Look IK applied)



    When aiming the pose looks a lot more natural:



    When turning off Aim IK and enabling Look IK I get a very natural idle pose while looking at the target:



    Is there an eloquent way you can think off to solve this so that I can get the natural pose provided by Look IK when in idle mode but still have all the wholesome goodness of the aiming during the animation transitions?
     
    Last edited: Apr 7, 2016
    Partel-Lang likes this.
  4. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,058
    You could link AimIK.solver.IKPositionWeight to your aiming animation weight.
     
    AlbertSwart likes this.
  5. AlbertSwart

    AlbertSwart

    Joined:
    Oct 17, 2015
    Posts:
    15
    Cool. Using your tip as a starting point I scanned the previous posts and found a similar question was asked before. FinalIK's forum postings a bit daunting at 36 pages :)

    So I started playing around with the above and managed to get fairly good results by using Curves for blending in and out. I realized during the process that for extreme angles etc. I would need to get a bit more sophisticated, but I'll take a similar approach than your 360 degree aiming sample to polish it out.

    The quick-and-dirty code looks like this:
    Code (csharp):
    1. using System.Collections;
    2. using UnityEngine;
    3. using RootMotion.FinalIK;
    4.  
    5. [RequireComponent(typeof(Animator))]
    6. [RequireComponent(typeof(AimIK))]
    7. [RequireComponent(typeof(LookAtIK))]
    8. public class AimCorrector : MonoBehaviour
    9. {
    10.     public Vector3 aimDirection = Vector3.forward;
    11.     public AnimationCurve AimIKAiming;
    12.     public AnimationCurve AimIKRelaxing;
    13.     public AnimationCurve LookIKWeightAiming;
    14.     public AnimationCurve LookIKWeightRelaxing;
    15.     public AnimationCurve LookIKBodyWeightAiming;
    16.     public AnimationCurve LookIKBodyWeightRelaxing;
    17.  
    18.     private bool lastAimingValue;
    19.     private Animator animator;
    20.     private AimIK aimIK;
    21.     private LookAtIK lookAtIK;
    22.     private float curveTime = 0.0F;
    23.  
    24.     void Start ()
    25.     {
    26.         animator = GetComponent<Animator>();
    27.         aimIK = GetComponent<AimIK>();
    28.         lookAtIK = GetComponent<LookAtIK>();
    29.         lastAimingValue = IsAiming;
    30.     }
    31.  
    32.     void LateUpdate()
    33.     {
    34.         if(lastAimingValue != IsAiming)
    35.         {
    36.             curveTime = 0.0F;
    37.             lastAimingValue = IsAiming;
    38.         }
    39.  
    40.         curveTime += Time.deltaTime;
    41.  
    42.         aimIK.solver.axis =
    43.             aimIK.solver.transform.InverseTransformDirection(gameObject.transform.rotation * aimDirection);
    44.  
    45.         if(IsAiming)
    46.         {            
    47.             aimIK.solver.IKPositionWeight = AimIKAiming.Evaluate(curveTime);
    48.             lookAtIK.solver.headWeight = LookIKWeightAiming.Evaluate(curveTime);
    49.             lookAtIK.solver.bodyWeight = LookIKBodyWeightAiming.Evaluate(curveTime);          
    50.         }
    51.         else
    52.         {
    53.             aimIK.solver.IKPositionWeight = AimIKRelaxing.Evaluate(curveTime);
    54.             lookAtIK.solver.headWeight = LookIKWeightRelaxing.Evaluate(curveTime);
    55.             lookAtIK.solver.bodyWeight = LookIKBodyWeightRelaxing.Evaluate(curveTime);
    56.         }
    57.     }
    58.  
    59.     private bool IsAiming
    60.     {
    61.         get
    62.         {
    63.             var result = animator.GetBool("IsAiming");
    64.             return result;
    65.         }
    66.     }
    67. }
     
    Last edited: Apr 11, 2016
    Partel-Lang likes this.
  6. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,058
    Hey, glad you got it working and cheers for posting the solution too! :)
    Pärtel
     
  7. tom_r

    tom_r

    Joined:
    May 12, 2015
    Posts:
    2
    Quick general question, your package looks great, and I want to persuade my company to get it, but I just want confirmation: would Final IK be able to do just Hand IK, so that you could dynamically grab objects of different shapes with a hand (that is not attached to a body, just the hand on its own) and defined "finger grab point"?

    I'm pretty sure this package could, just would like to double check :)
     
  8. Rtyper

    Rtyper

    Joined:
    Aug 7, 2010
    Posts:
    424
    Thanks, yeah - it's all being done by the solver. I actually semi-fixed it by just adding an extra joint to the arm, so it can swivel around the base too, I think it was more of a problem of the limits making it impossible to reach most positions that it was trying to.
     
  9. ahmed.rehman

    ahmed.rehman

    Joined:
    Feb 2, 2016
    Posts:
    1
    Hi Partel,

    I am using your plugin Final IK and found it a very useful and powerful for my work.
    I am struggling from few weeks and has been stuck to a following problem.
    Please can you help me out? It will be a great favor :)

    Problem:

    I am developing a dance application where user can move its limbs (Effectors) on tapping nearby areas.
    I have done my work regarding movements using Interactions. I creates an InteractionObject and starts interaction of selected effector. It going well as my effector moves towards that InteractionObject and returns to its default position.

    The problem I am facing is :
    I want to change default position of an effector on runtime. So that interaction start from that assigned default point and returns to it, (not to the default position assigned in start)
     
  10. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,058
    Hi!
    Yes, it is the LimbIK component you are looking for.

    Hey,
    You should be able to use effector.positionOffset for that.

    Code (CSharp):
    1. effector.positionOffset += desiredPosition - effector.bone.position;
    (Using += instead of = here because the solver resets positionoffsets to zero after each update, this enables for multiple simultaneous offset modifiers applied on top of each other)

    Cheers,
    Pärtel
     
  11. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    825
    Hi Partel,
    Any chance to expand Grounder IK to support hands too? Sort of Maya/Motion Builder floor contacts, where any limb can't get through floors.
     
  12. Partel-Lang

    Partel-Lang

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

    I can't extend the logic of Grounder to hands, but it should be quite easy to raycast down from above the positions of the hands and if the hit distance is greater than the distance from ray origin to the hands, move the hands up with FBBIK effector positionOffsets.
     
  13. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    825
    I have started to play around with positionOffsets. How do you prevent the hand effectors to affect the spine?
    I tried setting pull, reach and push to 0 and if I move the hand on the outside it's ok, but if I move the hand far on the inside(let's say the goal of the left hand is near the right hand) the spine start twisting on itself.

    Is there a way to let it affect up to the shoulder without the spine?
     
    Last edited: Apr 14, 2016
  14. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,058
    The only way other than limiting the positionOffsets is setting solver iterations to 0 which would disable full body solving and make it work basically like BipedIK.
     
  15. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    825
    Ok, I have solved it by always having a body target goal present.
    Now I have another issue, how can I get the default goal position, the one you display as blue balls in the avatar?

    I would like to initialize my targets with these positions and rotations. I tried to use the effector position but it seem it's not ready at start. How do I initialize it?

    EDIT:
    Had a look at the ikeffector class, just had to call Initiate. Hope there won't be issues by calling it at start.

    EDIT2:
    I think there is something wrong with the mid effector when you set the weights but not a target.
    For example when you move the body and thighs weight is zero, the thighs move normally, but if you set it to 1, the thighs stays in place.
    Shouldn't they move anyway? Otherwise like this you can't use positionoffset on mid effectors.

    EDIT 3:
    Is there any internal method I can call to rotate an effector, avoiding impossible rotations ?
    I am trying to implement some posing system to tween from one pose to another( I don't thnk there is any built in, is there?) and so far with positions it's easy but with rotation I can't just rotate toward the new rotation as the shortest route is not always the best, for example the wrist shouldn't rotate more than x angles.
     
    Last edited: Apr 15, 2016
  16. jbarbeau

    jbarbeau

    Joined:
    Dec 21, 2012
    Posts:
    46
    I am looking for someone who is knowledgeable about Final IK to use the AimIK scripts to make an IK drummer that responds to MIDI data.

    I have made an IK MIDI pianist partially and I have a project with that working. In the same scene, I've also made a drummer with a cool drum set, but I don't have time to fill in the AimIK code for the drummer.

    I have several projects going, but I think this WOULD BE INTERESTING TO SOMEONE OUT THERE. A chance to build an interesting application of IK. I plan on creating other IK musicians too. This idea could have a lot of applications. But right now, I just want an IK drummer.

    I can give you a project I've built which includes a MIDI input connection to any PC MIDI device. This is a PC only application. This project has a pianist partically working and a drummer and drums set. I imported the swing target IK to use that as a starting point. In watching tutorials it's not to far to get to a workable solution, but I am doing too many things. I'm looking for some collaboration.

    Is ANYONE INTERESTED IN LEARNING, OR DOING THIS? Click on my name and start a conversation. or (jaybarbeau at gmail) Possibly we can do much more together, doing things that could have long term income potential.

    See www.musycal3d.com for a summary of my concepts and things I'm working on.
     
  17. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    591
    Hi,

    Im working on the default scenario, biped with weapon, CCDIK for holding with the left hand and AimIK for the main hand. Now my biped character holds an RPG (anti tank gun) and it consists of 2 gameobjects, the weapon itself and the big visible ammo at the end of the weapon.
    The shot is triggered by an animation event and the callback method needs the position from the end of the weapon. This time (I guess before lateUpdate) the position is where it would be without AimIK changes.

    1. Are there some kind of transformations for vector3, which gives me the position for the IK changes before it is applyed on the object?
    2. Any suggestions for this problem?
    3. In what method are the changes already done, maybe I should read the position in late update?

    Additional: CCDIK, touching the weapon with the left hand, does not update correctly when AimIK makes changes. Its just an update problem, when I change a bit an attribute on the CCDIK, then the hand jumps to its desired position.

    4. Any suggestion for this, maybe I have to update the CCDIK in code?

    Thanks in advance for your answer.
     
    Last edited: Apr 17, 2016
  18. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    591
    I found a way for 1,2,3 but not sure that it is a good idea. DelayedShot() will be called from the animation event callback method. The key is the "yield return new WaitForEndOfFrame();", which waits until the end of the frame. "yield return null;" delay running the code in update to the next update method, i guess the next one is lateUpdate(). That was not enough, so I used WaitForEndOfFrame(). However, Im not sure about this fix, because it should be done in the correct update method. But maybe who cares, shot one frame later is okay.

    /** Will be triggered by Fire animation.
    */
    override public IEnumerator DelayedShot() {
    // At the end of the frame FinalIK made its changes for sure.
    yield return new WaitForEndOfFrame();
    ...

    For point 4 I use the "ccdIK.solver.Update();", but Im not sure about this, probably it is a too heavy update, or is it okay?
     
    Last edited: Apr 17, 2016
  19. Partel-Lang

    Partel-Lang

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

    There is no default goal position, there is a direction towards it:

    Code (CSharp):
    1. ik.solver.leftArmChain.bendConstraint.direction
    The targets are just helpers that enable you to set effector positions without writing any code. If there is a target, it will just set effector.position to that target in each update. If not, effector.position will stay where it was and if you weigh in effecotr.positionWeight, it will force the body part to stay in place. If you do not wish for this to happen, just weigh out the effector. If effector.weights override positionOffset and that happens with both mid and end effectors.

    First, rotate the effector to match the bone's normal animated rotation:

    Code (CSharp):
    1. ik.solver.leftHandEffector.rotation = ik.solver.leftHandEffector.bone.rotation;
    Then use Quaternion.RotateTowards to rotate it to your target rotation and you can define a max angle there.
    So instead of slerping a quaternion from A to B, you'll rotate it from it's normal rest rotation to A and B.

    Hi!

    It is perfectly OK to use solver.Update() in this scenario, it's the intended way of solving those update order related issues. Basically, each IK component is just a container for the IK solver, it only handles it's editor, initiation and updating procedures. You can take full command of the solver if you just disable the component in Start:

    Code (CSharp):
    1. ik.enabled = false;
    and update it's solver whenever you need by

    Code (CSharp):
    1. ik.solver.Update();
    Normally, all IK components update their solvers in LateUpdate. They have set theirselves to a very high value in the Script Execution Order, so they normally update after your own LateUpdate code.

    If you have multiple solvers, you sometimes need to do some calculations between their updates, so that's when solver.Update() is most useful.

    Cheers,
    Pärtel
     
  20. kdodman

    kdodman

    Joined:
    Apr 2, 2016
    Posts:
    5
    Partel, I'm having issues with trying to get your recoil script to work with FPSaiming script. Any ideas?
     
  21. beNice

    beNice

    Joined:
    Sep 12, 2014
    Posts:
    28
    Hello, Mr. Lang.

    FinalIK is unbelievable; thank you for all your hard work.

    Would it be possible to get a PlayMaker Action for the HitReaction script? There are no public variables or a way to tap into it.

    Thank you so much.

    beNice
     
  22. Partel-Lang

    Partel-Lang

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

    FPSAiming uses effector.position/positionWeight which will override positionOffsets applied by the Recoil. Is that the issue?

    Hey, no problem, here you go.

    Cheers,
    Pärtel
     
  23. kdodman

    kdodman

    Joined:
    Apr 2, 2016
    Posts:
    5
    Seams like it, simply nothing happens when not aiming down sights. When aiming the body reacts, but the hands arms and weapon do not. I'm sure its just an execution order thing, but I cant figure it out.
     
  24. beNice

    beNice

    Joined:
    Sep 12, 2014
    Posts:
    28
    Amazing. Thank you!
     
    Partel-Lang likes this.
  25. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,058
    Please import this package. I reworked the FPSAiming script to use positionOffsets instead and that enables Recoil to add it's offsets on top of it. Also added a demo scene.

    Cheers,
    Pärtel
     
  26. kdodman

    kdodman

    Joined:
    Apr 2, 2016
    Posts:
    5
    Awesome, you rock. Thank you Partel.

    Another quick question, I want to do a dynamic wound system, when a guy gets hit in the leg, he walks with a limp, when hit in the arm he cant aim as well. I'm thinking I can use the Amplifier to do a good limp system. And going to have to figure out how to make aim IK less accurate when your arm is wounded. Any quick tips to get me started in the right direction?
     
  27. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,058
    You can just set AimIK weight to a smaller value (aim.solver.IKPositionWeight). Or add a random vector to aim.solver.axis.
     
  28. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Hello everyone and @Partel Lang :)
    I just want to let you know that Slate is now tightly integrated with FinalIK for animating IK within cutscene and with realtime editor preview :)



    You can download the extension online if you want.
    It's been really great working with FinalIK for this!

    Cheers!
     
  29. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,058
    Hey, that looks incredible, I'll check it out ASAP,
    thank you for doing this! :)
    Does it enable us to use mutliple IK components on top of each other, like use LookAtIK for looking at stuff, then FBBIK on top of it for some interactions?

    Pärtel
     
  30. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    825
    Hi Partel,
    Could you add an onPostWrite event to the solvers to the next version? For now I have added it myself, but I think it's useful event to have.
     
  31. AlbertSwart

    AlbertSwart

    Joined:
    Oct 17, 2015
    Posts:
    15
    Hi Partel (guys)

    Do you know if anyone has managed to make a nice climbing system that works using FinalIK?

    So far climbing seems to be the darn hardest thing I've had to teach my character to do! I get that I can use IK goals to place the hands and feet during certain bits of the climb animations...but getting all of that to blend in and out automagically so that it looks sexy and natural seems more like animation art than science. :)

    I don't need to go as far as say Assassins Creed, but something along the lines that these guys are doing would be perfect:


    Any partial projects or prototypes that can get me going along the right track would be much appreciated.

    Thanks,
    Albert
     
  32. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,729
    I have a climbing system going, basically the key thing you need to do is be able to get nearest point to line for collision and resolve that to time t along line, so you can place the hand IK there. It's pretty simple, as the position along the line can be calculated by Vector3.Lerp(start, end, t) once you have t.
     
  33. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,052
    Hey,
    Thank you! I am glad you like :)
    Yes of course, action clips can be layered on top one another to animate different limbs or a LookAtIK and FBBIK one on top.
    By all means, if you check it out, please let me know if you have anything to suggest at all.
    Thanks!
     
  34. Goon-Studios

    Goon-Studios

    Joined:
    Mar 16, 2015
    Posts:
    8
    Hey Partel,

    I want to do something similar to the HitReaction demo, except with a quadrupedal model. What would be the best way to go about doing this. Would I need to create a FullBodyQuadrupedIK component and all of its associated classes similar to FullBodyBipedIK, or is there some simpler way?

    Thanks!
     
  35. Partel-Lang

    Partel-Lang

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

    There's solver.OnPostUpdate that is basically the same thing.

    That video, seems like it's just baked animation and no IK at all, just transitioning from state to state. So if you stand in a certain place it allows you to play a certain animation, that information seems to be pre-placed in the scene. A fully dynamic raycasting based system is much more complex. I have some experimentations on that, but they're very raw yet.

    You can use FullBodyBipedIK on quadrupeds actually, as long as they have 4 limbs it should be OK.

    Cheers,
    Pärtel
     
    00christian00 likes this.
  36. Goon-Studios

    Goon-Studios

    Joined:
    Mar 16, 2015
    Posts:
    8
    Ok great! What about animals with tails? What modifications would I have to make in that case?
     
  37. kdodman

    kdodman

    Joined:
    Apr 2, 2016
    Posts:
    5
    Would it be possible with FPS Aiming you use 2 gun targets, one for when looking down Sights, and one for normal aiming? So we dont have to rely on the animation as much for the main gun position.
     
  38. tani41

    tani41

    Joined:
    Feb 23, 2016
    Posts:
    10
    How To Set The Positions of hands while picking Objects through final Ik? characters hands and body parts bends when it pick an object?
     
  39. ACarrozzini

    ACarrozzini

    Joined:
    Mar 24, 2013
    Posts:
    16
    Hi, you can follow the tutorial made by Pärtel :


    It's very well done and clear.

    Hope it will guide you.

    Antonio.
     
    Partel-Lang likes this.
  40. Partel-Lang

    Partel-Lang

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

    You can add another IK component to solve on top of FBBIK to control the tail. Check out this old video.

    Yes, but then it would be easier to just use one and keep the sight weight at 1 at all times and and use a one-liner to lerp the gun target transform between 2 positions.

    Pärtel
     
  41. tani41

    tani41

    Joined:
    Feb 23, 2016
    Posts:
    10
    thnks Antonio
     
  42. bulisor

    bulisor

    Joined:
    Feb 12, 2016
    Posts:
    7
    Hi sir!
    I really like your plugin final ik. I'm new to this tehnology, but i'm learning. :)) I try to implement motion absorb in a chopping tree, and I don't know how to make the tree to not move, and stop animation, I want a "total" absorb.
    The example from packet has a "partial" absorbtion, and I don't know witch component I have to change to accomplish this. Thank you, and sorry my english.
     
  43. Dracin

    Dracin

    Joined:
    Feb 25, 2014
    Posts:
    10
    Hey Pärtel,

    A quick question. I'm looking for a solution to a game mechanic I'm trying to develop. Basically I need to be able to grab an enemies arm/hand and swing them by the grabbed body part slamming them into the ground. I've watched your video "MappingToRagdoll" which seems to be a good starting point.

    I thought I would ask before purchasing. If you can help me out it would be greatly appreciated. Cheers.
     
  44. Partel-Lang

    Partel-Lang

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

    Go to the MotionAbsorb component and expand the Absorbers. Each one has a weight. If you you set the weight of the hand effector to 1 it should absorb fully.

    Hi!

    The MappingToRagdoll stuff in Final-IK is basically faking physics with inverse kinematics. You'll probably need real physics for what you are doing so you might be interested in my other asset instead.

    Cheers,
    Pärtel
     
  45. bulisor

    bulisor

    Joined:
    Feb 12, 2016
    Posts:
    7
    Thank you for the fast reply. I'll try.
    But I have another little question. :)
    I have to build a house, piece by piece, and I used AimIK foreach piece,.. it's ok ? ... I don't know which extension from Final IK to use :). In this situation AimIK is not very precise, but ...
    https://vid.me/Fluu
     
  46. Dracin

    Dracin

    Joined:
    Feb 25, 2014
    Posts:
    10
    [QUOTEHi!

    The MappingToRagdoll stuff in Final-IK is basically faking physics with inverse kinematics. You'll probably need real physics for what you are doing so you might be interested in my other asset instead.

    Cheers,
    Pärtel[/QUOTE]

    Thanks for the speedy reply. The reason I was thinking FinalIK oppose to Puppet Master was that I already have the enemy character converted to a ragdoll and attached to the characters hand with a joint via script. My main problem is poor looking holding positions. I'm guessing if I used Puppet Master it would be a case of controlling the enemy being swung around via animation and adjusting the pin weight? If thats the case, can I keep the grabbed body part pinned? Sorry for all the questions.
     
  47. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,058
    Whatever works is OK. You could also try animation warping. See the "Soccer Kick" demo. Basically the same thing done for the foot could be done for the hand that is holding the hammer. You can place a marker where the hammer hits the target in the animation (parent it to the root of the character), similar to the "Animated Hit Point of the Ball" in the Soccer Kick demo, then if you know where the real object to hit is in the scene, you can use the AnimationWarping component to get the hand where you need it to be.

    Thanks for the speedy reply. The reason I was thinking FinalIK oppose to Puppet Master was that I already have the enemy character converted to a ragdoll and attached to the characters hand with a joint via script. My main problem is poor looking holding positions. I'm guessing if I used Puppet Master it would be a case of controlling the enemy being swung around via animation and adjusting the pin weight? If thats the case, can I keep the grabbed body part pinned? Sorry for all the questions.[/QUOTE]

    Oh, right, in this case Final IK can help you, especially because the joints in Unity5 are quite lousy.
    You can connect the enemy to a kinematic Rigidbody attached to your character, then use FullBodyBipedIK to move the hand of the character to the connected body part of the enemy. PuppetMaster can help you there if you need the enemy not to look completely dead.

    Cheers,
    Pärtel
     
  48. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,300
    Hi,

    Does it support 2D? Is it possible to modify body parts' movement at runtime?

    Thank you
     
  49. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,058
    Hi,
    Some of the solvers have a 2D toggle, such as AimIK, CCD, FABRIK and LimbIK can be constrained to 2D as well.
    FullBodyBipedIK will not work in 2D though.
     
  50. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,058
    Hi all,
    Just to let you know, I'll be off the grid next week so probably wont be able to answer any questions before the week after that.

    Best,
    Pärtel
     
unityunity