Search Unity

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

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

  1. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    I have not used UFPS, but FinalIK is a general purpose IK tool, so I'm sure you can bind it with pretty much everything.
    I imagine with UFPS you'd like to use IK to put the real hand of the character on the gun, not just use the severed FPS arm, right? That you can do, just set the FPS hand bone as the IK target for your full body character's hand and just rotate the finger bones to match the animated UFPS fingers.

    The problem you might have is that when you make a real character hold a gun, with 60 degrees of FOV, that gun would be quite a bit closer to the camera than you are used to see in a FPS game. If you moved the gun further away, it will be difficult/awkward to reach for a full body character. But in the end it's all just the matter of tweaking.

    There is also a small Full Body FPS demo scene included in the FinalIK package, that shows you how to use AimIK/FBBIK to aim in FPS view and also lift the gun to look through the scope.

    Pärtel
     
  2. lushdog

    lushdog

    Joined:
    Apr 30, 2014
    Posts:
    16
    Thanks for clarification Partel.

    I have a question about using offset for posing.

    So imagine i want the player to start in the kneeling position. In play mode I can set effector weights and positions via the UI to get the user into the kneeling position. From there I can take those effector positions and use them as targets to pose via position.

    How would I do same to pose via positionOffset? Since weights are ignored the kneeling position is a bit whacky when I pose via offset to the same targets.

    Basically I need a way to know what the target offsets are for the kneeling pose.

    Or, is there a way to pose the character using positions and weights and the 'reset' the effectors so that it can keep the kneeling position and set all effector weights and positions to 0?

    Am I making my question clear? I can send videos or images if that would help.

    Matt
     
  3. Venged

    Venged

    Joined:
    Oct 24, 2010
    Posts:
    500
    Where in the documentation can I find how to set up my own character? I want to set a Aim IK like the one in the demo.

    Great Asset! I finally bought it:)

    Thanks
     
    Last edited: Sep 12, 2014
  4. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    Venged .. Here .. Hope this helps, like you say great asset
     
    Venged likes this.
  5. Venged

    Venged

    Joined:
    Oct 24, 2010
    Posts:
    500
  6. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Not sure I follow you here, but I made a quick demo scene for you.

    After I had done that, it occured to me, if you need to just get your character to a static pose, you don't need to use IK at all. Just pose a duplicate of your character in scene view, then make a script that goes through all the bones and lerps their localRotations to match the targets:

    Code (CSharp):
    1. bone.localRotation = Quaternion.Lerp(bone.localRotation, boneTarget.localRotation, poseWeight);
    ..if thats what you need. :)

    Thanks, Griffo and Venged, for the compliments :)

    Cheers,
    Pärtel
     
  7. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Oh crap, just realised I made that demo with Unity 4.6 Beta18 (its friday), can you use it?
     
  8. lushdog

    lushdog

    Joined:
    Apr 30, 2014
    Posts:
    16
    I think that is exactly what I need to do. I was fixated on doing it with Effector positions but I want to start from a pose and move effectors from there. I'll try this out thanks.

    Matt
     
  9. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hi all,

    I have fixed a bug with 0.4 (thanks to Maxime Charbonneau, Hugo Hall), that doesnt allow scaling FBBIK characters after they have been initiated. It might also produce inaccuracies with unscaled characters, so I will immediately prepare a 0.41 for the Store. In the meanwhile, please download this hotfix.

    Sorry for the inconvenience,
    Pärtel

    Edit: 0.41 submitted, pending review
     
    Last edited: Sep 15, 2014
  10. LudiKha

    LudiKha

    Joined:
    Feb 15, 2014
    Posts:
    140
    Hi Partel,

    In your Aim IK update, I think you need to fix the "RotateToTarget" method to take the pole axis into account ("poleAxis" in line 20).

    Code (CSharp):
    1.         /*
    2.         * Rotating bone to get transform aim closer to target
    3.         * */
    4.         private void RotateToTarget(Vector3 targetPosition, IKSolver.Bone bone, float weight) {
    5.             // Swing
    6.             if (weight >= 0f) {
    7.                 Quaternion rotationOffset = Quaternion.FromToRotation(transformAxis, targetPosition - transform.position);
    8.                 bone.transform.rotation = Quaternion.Lerp(Quaternion.identity, rotationOffset, weight) * bone.transform.rotation;
    9.             }
    10.  
    11.             // Pole
    12.             if (poleWeight > 0f) {
    13.                 Vector3 poleDirection = polePosition - transform.position;
    14.  
    15.                 // Ortho-normalize to transform axis to make this a twisting only operation
    16.                 Vector3 poleDirOrtho = poleDirection;
    17.                 Vector3 normal = transformAxis;
    18.                 Vector3.OrthoNormalize(ref normal, ref poleDirOrtho);
    19.            
    20.                 Quaternion toPole = Quaternion.FromToRotation(transform.rotation * poleAxis, poleDirOrtho);
    21.                 bone.transform.rotation = Quaternion.Lerp(Quaternion.identity, toPole, weight * poleWeight) * bone.transform.rotation;
    22.             }
     
  11. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hi, Ragoo,

    Yes, that is already fixed in the update I submitted earlier today, thanks.

    Pärtel
     
  12. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    945
    Hi Pärtel it's me again the guy of the errors xD, do you have any hint why this is happening? :
     
  13. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hi, Kirby, which Grounder component are you using?
     
  14. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    945
    Hi Pärtel thanks for the fast reply, i'm using Grounder FBBIK, it's like it don't get the good pose or something.
     
  15. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Are you sure it is initiated correctly, I mean in the Scene view, when not playing, is the little arrows on the knees pointing towards character.forward?
     
  16. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    945
    I'm setting it up via script and all seems correct for me
     
  17. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Is it an UMA character, whats the code you are using?
     
  18. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    945
    Code (CSharp):
    1. void AddFBBIK (GameObject go, BipedReferences references = null) {
    2.  
    3.         if (references == null) {
    4.             BipedReferences.AutoDetectReferences(ref references, go.transform, BipedReferences.AutoDetectParams.Default);
    5.         }
    6.    
    7.         ik = go.AddComponent<FullBodyBipedIK>();
    8.         ik.SetReferences(references, null);
    9.  
    10.         scriptsManager.ik = ik;
    11.     }
    12.  
    13.     void AddGrounder (){
    14.  
    15.         GrounderFBBIK grounder = characterGO.AddComponent<GrounderFBBIK>();
    16.         grounder.solver.layers =  ~(1 << 9);
    17.         grounder.solver.maxStep = 0.5f;
    18.         grounder.solver.heightOffset = 0.012f;
    19.         grounder.solver.footSpeed = 2.5f;
    20.         grounder.solver.footRadius = 0.15f;
    21.         grounder.solver.prediction = 0.05f;
    22.         grounder.solver.footRotationWeight = 1;
    23.         grounder.solver.footRotationSpeed = 7;
    24.         grounder.solver.maxFootRotationAngle = 45;
    25.         grounder.solver.pelvisSpeed = 5;
    26.         grounder.solver.pelvisDamper = 0;
    27.         grounder.solver.rootSphereCastRadius = 0.1f;
    28.         grounder.spineBend = 2;
    29.         grounder.spineSpeed = 3;
    30.         grounder.ik = ik;
    31.         characterGO.layer = 9;
    32.  
    33.         scriptsManager.grounder = grounder;
    34.     }
    Yes it's an uma, i don't know if it matter but i'm blending animations, one for the upper body and one for the bottom.

    PD: I will return in a hour, i don't know if you will stay here but anything i need to do or to test post here and i will see it.
    Thanks a lot!
     
  19. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    If its UMA and you are initiating FBBIK in play mode, it is kind of difficult to tell if the character is in a valid pose at that time.
    Thats why I've made the limb orientations definition for things like that..

    put this line after you call SetReferences:

    Code (CSharp):
    1.  ik.solver.SetLimbOrientations(BipedLimbOrientations.UMA); // The limb orientations definition for UMA skeletons
    Read more about this from the User Manual, there is a section "Adding FullBodyBipedIK in runtime (UMA)."

    If this doesn't work, download and import the hotfix for FinalIK 0.4 that I posted yesterday. It will be also included in FinalIK 0.41 that should appear to the store in a few days.

    If still not fixed, please write me to support@root-motion.com with some more information or a package containing that rig if you can.

    Cheers,
    Pärtel
     
  20. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    945
    Thanks Pärtel will try, even if you think i didn't read the documentation i did a lot of times but since i'm from Spain and can't understand some things i maybe didn't notice it haha.

    Thanks again for your support :) will let you know
     
    Partel-Lang likes this.
  21. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    945
    Hi Pärtel just want to tell you that the hotfix worked flawless, also thanks for the limbs code.

    It solved the problems of the arms being crazy too thanks a lot :)!
     
    Partel-Lang likes this.
  22. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    945
    Oh Pärtel one thing that is odd is i can't view your webpage :S
     
  23. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hi, thats odd, seems to be online to me, anyone else having this problem?
     
  24. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    No problem reaching your website from here.
     
    Kirbyrawr and Partel-Lang like this.
  25. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    945
    I will try via proxy then :S
     
  26. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    How work's the new hitreaction system because i use him lot
    in game publish last week !
     
  27. Partel-Lang

    Partel-Lang

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

    Add the HitReaction component to a gameobject and start filling out the Hit Points.
    Name - just for you to better see what body part you are dealing with
    Collider - the collider of the bone associated with the hit point, used in ray casting
    Cross Fade Time - time of fading in a new hit if already processing an earlier hit
    Offset In Force Direction - the animation of moving the effectors in the direction of the force when hit
    Offset In Up Direction - the animation of moving the effectors in the direction of character.transform.up when hit
    Effector Links - connecting the hit point to FBBIK effectors

    Then you can call the hits using this code:
    Code (CSharp):
    1. void Update() {
    2.             // On left mouse button...
    3.             if (Input.GetMouseButtonDown(0)) {
    4.                 Ray ray = cam.ScreenPointToRay(Input.mousePosition);
    5.  
    6.                 // Raycast to find a ragdoll collider
    7.                 RaycastHit hit = new RaycastHit();
    8.                 if (Physics.Raycast(ray, out hit, 100f)) {
    9.  
    10.                     // Use the HitReaction
    11.                     hitReaction.Hit(hit.collider, ray.direction * hitForce, hit.point);
    12.                 }
    13.             }
    14.         }
    15.  
    Take a look at the Hit Reaction demo scene to see how it could be set up.

    Good luck with your game!
    Pärtel
     
    Kirbyrawr likes this.
  28. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    FinalIK 0.41 is uploaded to the Store. Please upgrade, it will take care of some big bugs that appeared with 0.4.

    Pärtel
     
    Kirbyrawr and Ony like this.
  29. duencil

    duencil

    Joined:
    Dec 17, 2012
    Posts:
    91
    I have the same problem as KirbyRawr connecting to your website. I'm in spain too, it may be we share an ISP.
     
    Kirbyrawr likes this.
  30. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hi, looks like you have some secret government web filtering going on in Spain. :)
    Anyway, thats weird, I'll ask my service provider about this..

    Pärtel
     
  31. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    You cant access the User Manual either, right?
    I can zip you an offline version in the meanwhile if you'd like.
     
    Kirbyrawr likes this.
  32. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    945
    Yeah we can't access anything from your web, it's so weird because i didn't have any problem with other pages :)
     
  33. sowatnow

    sowatnow

    Joined:
    Jun 12, 2014
    Posts:
    309
    Hi Partel,

    Is is possible to use this for RPG?
    What I want is to target enemy specific part when a key is pressed. I can it see it works if i have an animation playing and moving target object. But this doesn't work If I press attack button. Player attacks in the direction its facing.
     
  34. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
    Hi Pärtel!

    I've been toying with the HitReaction Scene to find out if I can make it work for my quadruped. (Its a dog, and I want to use 'hits' to make the dog respond softly to touch, to allow the player to caress the dog.)

    So I've temporarily replaced the Grounder-Quadruped component for a FBBIK component on my dog. Then I got stuck right away because the FBBIK component doesnt seem to like the fact that my quadruped isn't in an upright pose. There are various poses in which I would like it to be able to receive hits: on all fours, sitting, and lying down. Obviously, the dog doesnt have a T-pose. However, the skeleton is easily mapped on a biped (i.e.: four bones for each of the hindlegs, with the final paw-bone equalling 'toes'; five bones for each of the forelegs, with scapula equalling clavicle; four spine-bones; three neck-bones plus head).

    Could you just tell me whether hit-taking this is something that could meaningfully be achieved with the FBBIK component on my rig or whether I should wait for your full-body-generic-IK-component (assuming you're still planning on integrating that into the 1.0 release)?

    Cheers, Wendelin
     
  35. Jesse_Pixelsmith

    Jesse_Pixelsmith

    Joined:
    Nov 22, 2009
    Posts:
    296
    Hey, just picked this guy up, having fun playing with it!

    Using the AimIK I was able to get something going like this from an existing "aim" animation. The gun is in the right place more or less, but the hands are a bit off - what else would I use to gain the best result? I'm using the UMA avatar



    Cheers :)
     
  36. Jesse_Pixelsmith

    Jesse_Pixelsmith

    Joined:
    Nov 22, 2009
    Posts:
    296
    Ok I'm going over a bit of the third person demo now, looks like I need to use FBBIK there.

    Another question on top of this though - how would I setup a reload animation to work with this?

    Obviously the reload animation will be a bit custom for each gun, so is there a way to say make a base reload animation and somehow additively combine it with whatever Final IK is doing? I'm using the Mecanim animator.

    Here's an example of what I mean:
     
    Last edited: Sep 29, 2014
  37. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hey, did you mean making sword attacks hit a target?
    Have you already seen this video?

    Hi,
    What do you mean by "the FBBIK component doesnt seem to like the fact that my quadruped isn't in an upright pose"?
    If its a console warning, you can just ignore it. It should work fine as long as the limbs are bent in their natural directions.

    Hi,

    Are you sure the gun is properly in his hand in the animation? Because AimIK just rotates the bones, if the gun is parented to the right hand, it would not dislocate in the AimIK solving process. The left hand will be dispositioned by AimIK only if any of the right arm bones is included in the "Bones". In that case you would need to use LimbIK/FBBIK to put the left hand back on the gun each frame after AimIK is done.

    I'll answer your second post in a minute...
     
  38. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Ok, so the reloading.. :)

    Its no problem making reloading animations with AimIK. If you use only the spine bones, then it doesn't really matter what the left hand does, it will always be where it was animated relative to the gun. If you used any of the right arm bones in AimIK, you'll have to put the left hand back to where it was in animation (relative to the right hand), like in this video.

    If the reloading animation includes significantly changing the orientation of the gun, such as pumping a shotgun with a single hand, then please read the last paragraph of the AimIK User Manual.

    Its a bit of a pain to make reloading animations with the hand that is holding the weapon like in the video though. You'll have to start by thinking how you can animate this in the 3D animating software in the first place.

    One way would be to dynamically change the parenting of the gun between the hands. So if the right hand lets go of the gun, it would be parented to the left hand and vice versa. This would not be carried through to Unity via FBX so you'd have to use Mecanim Events to do the same thing all over again in Unity. While reloading a rifle like that, you don't need to be aiming anyway, so you can just weigh out AimIK for that time.

    Another solution would be to use a virtual "hand" for holding the gun. So in your 3D animation app, you create a null, parent it to the last bone of the spine, and parent the gun to it. then use whatever IK solver in the app to put the left hand to the gun as you normally would and also the same for the right hand. Then both hands would be free to leave the gun at any time. Once in Unity, you could use the spine bones as the "Bones" of AimIK and the gun parent trasform as the "Aim Transform" and still be able to aim the weapon.

    I hope that was of some assistance,
    let me know if you have any more questions. :)

    Pärtel
     
  39. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
    Thanks for pointing out my wrong assumption, I realized I had just misunderstood your HitReactionCharacter.cs script! When I stopped trying to mix in another animation, the character stopped behaving weirdly. And lo and behold, the hit reaction thing works right away on my quadruped. AWESOME, as always! Cheers /W
     
    Partel-Lang likes this.
  40. Jesse_Pixelsmith

    Jesse_Pixelsmith

    Joined:
    Nov 22, 2009
    Posts:
    296
    Hey Partel,

    Thanks for getting back to me. Looks like there are a few options to proceed, I'm leaning towards one of them but I should clarify a couple of things:

    -The animation I have is a generic M4 holding animation from Mixamo, and retargetted to the UMA rig - it doesn't exactly fit the gun I have to begin with, so I was hoping that the FBBIK would correct the hand placement as you have here:


    This is from the third person demo project, and if I'm seeing correctly, you actually don't even use an aim animation here, but rather the FBBIK and some generic posers to place the hands and make the fingers act appropriately.

    However from what I gather, because the FBBIK is essentially "gluing" the hands to the gun, it makes any kind of reload animation difficult. (And yes on the AimIK I've only used the Spine)

    In this case, I probably need to have custom animations for each gun type, because the reload will almost certainly need to be custom anyways. (And I want to be able to reload, or at least chamber a round, from any vertical angle).

    For my case I'm really only using the vertical space for AIM IK, any horizontal movement of the target and I will simply rotate the character (or rather the player will rotate themselves :)

    One of the things I'm concerned about with this however - I need a way to blend these custom gun animations with my movement animations, with 8 directions of movement, that could be 8 animations just for holding each gun, which I'd like to avoid.

    I'm also planning on having an "aim down sights" animation. Again I was thinking that FBBIK could solve this by just moving the hand targets around, but maybe it's better off just to have a custom animation for it.

    So going with this logic, assuming I'm holding a K98 rifle. My best bet seems to be to use the following animations:
    -Hip Hold
    -Hip Fire
    -Aim Down Sights Hold
    -Aim Down Sights Fire
    -Chamber Round
    -Reload clip

    combined with the legs of (somehow?):
    WalkForward
    StrafeRightForward
    StrafeRight
    StrafeRightBackward
    WalkBackward
    StrafeLeftBackward
    StrafeLeft
    StrafeLeftForward

    And then I could get by with just using AimIK with the Spine right?

    Is there anything else I could do to to use less anims or make things more efficient, without making reloads look too strange?

    Cheers :)
     
  41. Partel-Lang

    Partel-Lang

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

    Gluing the hands to the gun is the reason why I sometimes regret adding the 3rd person shooter demo to the package. It will be quite difficult to build a good aiming system if already the animation data is inaccurate, but it can be fixed with IK without gluing the hands. So as I understand, the first problem is that the Mixamo animation does not match the gun that you are using. That we can fix with offsetting the left hand, not gluing it, like so:

    Code (CSharp):
    1. public Vector3 leftHandOffset;
    2. public FullBodyBipedIK ik;
    3.  
    4. void LateUpdate() {
    5. ik.solver.leftHandEffector.positionOffset += ik.solver.rightHandEffector.bone.rotation * leftHandOffset;
    6. }
    That piece of code adds to the positionOffset of the left hand effector (always use positionOffset additively, it allows for multiple offset modifiers because positionOffset will be reset to zero by FBBIK after each update). Note that the offset will be added relative to the rotation of the right hand (that holds the gun), so the offset value will rotate along with the gun.

    Parent the gun so it is held nicely by the right hand so there should be no need to do IK on it. Then play the scene with that script attached and adjust the leftHandOffset value until the left hand is in the required position, right click on the component and copy/paste its values from play mode to editor mode.

    That should fix the gun holding issues. From there it should be no problem using AimIK to take care of the aiming other than the fact that AimIK by default solves before FBBIK, but we don't want that in this case. You can take care of updating them manually by disabling both components at Start (ik.Disable();) and updating them manually in LateUpdate (ik.solver.Update();) in the required order after you have done your calculations.

    You can make your aiming/reloading/shooting animations independent of the locomotion if you have the locomotion on the base layer and the aiming on a layer on top of it with an upper-body Avatar Body Mask.

    Cheers,
    Pärtel
     
  42. davidsirmons

    davidsirmons

    Joined:
    Mar 16, 2014
    Posts:
    190
    About the spinning wheel/piston problem earlier, it can likely work in reverse, so that the armature and sliding piston are solving to orient to the spinning wheel 'attach' point, rather than trying to slide the piston/armature and have the wheel solve.

    Partel, is there some means to get say, a startup animation to play, then for your system to take over at the end of the startup animation? I'm designing tripedal machines that will launch from orbit, land by impacting a planet surface, then do a startup animation. But as large as they are, going over terrain could be handled by your solution. Please let me know.
     
  43. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hi, David,

    I'm sure there is a solution, but I'm not sure I fully understand what you described, can you PM me a screenshot of the model or a drawing or something?

    Cheers,
    Pärtel
     
  44. davidsirmons

    davidsirmons

    Joined:
    Mar 16, 2014
    Posts:
    190
    Hello, Partel. I was trying to give insight to the person that posted this:
    http://forum.unity3d.com/attachments/kolben-jpg.82488/
    It wasn't my post of course, just trying to help him out.

    For my question, I was asking if an imported character could have a startup animation where it unfolds or stands up. And after that, your animation system takes over. And no, Mecanim can't be used unless tripedal characters can be done with it.
     
  45. sowatnow

    sowatnow

    Joined:
    Jun 12, 2014
    Posts:
    309
    Yes that's what I mean. I played with that demo, but it wouldn't work the way i want it to. Do I have to attach all targets to player?
    The player attacks fine, when animation is looping.
    Can you please provide a tutorial on how it could be used in action against enemies using fire button etc?
     
  46. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hi,
    Did you see the "Aim Swing" demo scene? It has a target that you can move around and the character will swing at it with a prop. I can't see whats going on in your project exactly and why the character is only attacking forward, it might be even something completely unrelated to IK. Can you send me some screenshots, code or a video of that problem? Because the answer really depends on the kind of animations you have and stuff like that.
     
  47. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541
    Hi, I have been using your nice asset for some time now, it is great in my bike game, hopefully you could give me some advise on how to do the following, probably really simple but I am not sure how to approach it yet.
    In my bike game, if the bike falls over and the rider needs to dismount or fall off, how can this be done?
    I think I need to turn off all the Final IK scripts maybe so the human model just kind of falls with gravity?
    How would you recommend I do this falling off a bike?
    Currently I am using final IK to move the rider around when steering the bike and body movment and effetors are used to follow pedals + handlebars..
    Advise would be much appreciated :)
     
  48. lushdog

    lushdog

    Joined:
    Apr 30, 2014
    Posts:
    16
    Hi Partel,

    Few follow up questions about posing character into kneeling position without IK and then enabling IK for interactions.

    Here is the flow I'm looking to achieve:
    Instantiate prefab -> Pose -> Move effectors and interact with other prefab -> Pose -> Move effectors and interact with other prefab.....

    Perfect outcome after the Pose call is:
    Character is posed, Effectors positions are over location of posed bones, IK enabled so can pose in Play Mode for debugging etc.

    Here are some methods I've tried and their outcomes:

    Scenario #1
    Enable IK in editor for prefab-> Play Mode -> Pose in first frame via code
    Outcome: Bad, root bone is rotated but all child bones not changed, characters is 'planking' instead of kneeling

    Scenario #2
    Enable IK in editor-> IK.Disable() in first frame -> Pose in first frame -> IK.enabled = true in second frame
    Outcome: Bad (same outcome as #1)

    Scenario #3
    Enable IK in editor -> IK. Disable() in first frame -> Pose in first frame -> _ik.solver.Update() subsequent fames
    Outcome: Better, character is posed but effectors are not positioned over posed bones but rather neutral pose bone locations, IK component not active in UI but using slider for effector weighs will pull character from kneeling up to standing/neutral

    Scenario #4
    IK Not Enabled in UI -> Pose in first frame -> IK.enabled=true in second frame
    Outcome: Perfect, character is kneeling, effector positions are in kneeling positions, IK component is active in editor and interactions with Effectors in play mode work perfect

    I have a feeling that if I was add [Disable IK -> Pose -> IK.enabled=true] to scenario #4 i would achieve the outcomes of Scenario #1 and #2.

    It seemsthat you can't truly disable and enable the IK component in code and get the outcome I'm looking for.

    How about:
    Remove IK component -> Pose -> Add IK component -> Enable IK -> Do something -> Remove IK component -> Pose -> Add IK component....?

    Or:
    Instantiate prefab character w/ IK off -> Pose -> Enable IK -> Do something -> Delete prefab -> Instantiate prefab w/IK off-> Pose -> Enable IK...

    Any thoughts on this Partel?

    Thanks in advance,

    Matt
     
  49. S-0-L-0

    S-0-L-0

    Joined:
    Nov 9, 2012
    Posts:
    163
    Hi Partel,

    Where can we see the roadmap for Final IK and what can we expect from 1.0? Will it be possible to fully animate a character with physics similar to this video?:



    Would physics driven animations reduce cpu usage compared to current animations, or would the physics end up being the same if not more cpu intensive?

    It would be nice if Final IK and physics could be used to improve performance on animations since they usually have the biggest impact on mobile performance.

    Thanks in advance,
     
  50. bhads44

    bhads44

    Joined:
    Feb 19, 2013
    Posts:
    37
    Hello Partel,

    Is there any way I can use Final IK to initiate a maximum slope for my character? Any tips would be welcome.

    Thanks.