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

    sandboxgod

    Joined:
    Sep 27, 2013
    Posts:
    366
    Man this plugin looks incredible.
     
    hifar likes this.
  2. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Yea I'd like to know what this is too...
     
  3. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Oh, I forgot to ask this...

    ...but at 1:54 you say that AimIK was interfering with the animation. You then add a few lines of code and immediately the spine begins to behave they way you expect it to.

    Perhaps with the full documentation explaining what your functions do I'd grasp this easier, but for now can you explain why adding Targeting and Offsets allowed the original animation to play correctly AND still aim at the target (and why initially AimIK was interfering with the animation playback)?

    Thanks Partel
     
    Last edited: Jan 19, 2014
  4. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Looking at how amazing this can be for animations and interaction, do you know what scares me?
    That someone will swoop down and buy it up. And that's the last we'll see of it at a reasonable price!

    Granted...the only ones who might "buy it up" would be UT.
     
    Last edited: Jan 19, 2014
  5. Tonmeister.

    Tonmeister.

    Joined:
    Mar 30, 2013
    Posts:
    27
    Hi,
    I'm attempting to use the Biped IK aim functionality on my character and I'm running into problems. how can I keep the aimpoint infront of my character instead of, whats happening now, is that it is left behind as he walks forward?

    Ive also tried with just AimIK,
    I noticed, another object is created after the aim transform. This seems to be the final in the linked system, yet it doesn't move with everything else, warping my character.

    thanks
     
    Last edited: Jan 19, 2014
  6. Rohac

    Rohac

    Joined:
    Dec 16, 2013
    Posts:
    3
    Nice cooking Partel :) Did you add a new feature to do this or is it just a new demonstration of what we can already do with the first beta package ? Cause I was already thinking we can open a door and many other interaction before to buy it. But I you have added some new "shortcut" to do this, I'm happy too :)
     
  7. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Haha i am glad i never learned to animate properly and good, becouse now i have good reason why i certainly dont have to. That procedural driven video is amazing.
     
  8. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Ok, the way I see it, each action/interaction has 3 stages. Ping (from base state to IK state), Mid (some iterati0n of motion), and Pong (from IK state to base state).

    Let's look at an avatar stood by a console, typing (or pressing buttons). The Ping is from idle to hand over the buttons. The Mid could be a continuous loop of some button presses. The Pong would be from hand over buttons to idle).

    How about a wave emote? The Ping raises the hand, the Mid rotates the wrist a few times, and the Pong lowers the hand.

    Hand on hips idle? The Ping move the hand to the hips. We might not want a Mid or Pong yet - keeping the hand on the hips until we want to do something different, at which point we'd play the Pong first (moving hand from hips to base idle).

    Sitting idle. The Ping would be from standing idle to sitting. The Mid isn't used. The Pong we'd play later, when we want the avatar to stand again. In this case, we'd need to remember that the avatar is sitting, and let other actions/interactions play in the mean time; maybe typing on a console, reading a newspaper, gesticulating whilst talking, etc.

    So, I can see a need for the ability to play just one or more stages of the action/interaction, or continuously loop a stage. I can also see the need for the Mid stage to be made up of either none/a single/multiple elements.

    Did any of that make sense?
     
  9. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Since I'm located almost exactly at the other side of the globe, the general direction to shake your fist to would be Vector3.down ;)


    Those two questions are actually about the same thing... First, let me explain you how Aim IK works. Basically it is just bending and twisting a hierarchy of bones (that you assign to the "Bones" of the component) so that a child of that hierarchy (the Aim Transform) would be rotated to the target direction.

    Imagine aiming a gun for example. Let's say you have a static aim forward pose and the AimIK component set up so that the gun is the Aim Transform and the spine bones are assigned to "Bones". Now if you move the AimIK IKPosition around, it will take the FromToRotation from the animated direction of the gun to the desired target direction and bend the spine accordingly. Thats the normal use case for Aim IK, that it was designed for - keeping something directed to a position at all times.

    That works fine with aiming guns, because you are supposed to keep the gun aimed at something when you shoot it. But with sword swinging or boxing, we can't use that solution, because those animations have spine movement and if we keep the last bone of the spine fixed to a direction with AimIK, it will obviously change how the swing looks.

    We don't want that, we just want to use the animated swing by default and only bend it when the target direction is different from the default direction. Thats why we need the pin - the direction to the pin will be our default direction.

    We can make it the default direction by making the Aim Transform look in the pin direction before Aim IK solves, so when it does, and if the target position is the same as the pin position, it will find that it has nothing to do, because the Aim Transform is already looking at the target and the animation remains unmodified. But if we now offset the target from the pin, the directions are different and AimIK will bend from default direction to target direction.

    I know its mind boggling S***, but it works, and can be quite helpful at times :)

    If it's still too confusing, let me know, I'll try drawing a scheme or something.

    Hi, Tonmeister, and welcome!

    That's how it's supposed to work, you need to tell the solver where to aim or look at, or where to put the hands and feet. If you don't, they will remain where they were at Start().

    There is no object created after the aim transform, it is the scene view handle for the target for your debugging convenience. You can change where to aim at by:

    Code (csharp):
    1.  
    2. public AimIK aimIK;
    3.  
    4. void LateUpdate() {
    5.    aimIK.solver.IKPosition = something;
    6. }
    7.  
    ..and don't forget to include the RootMotion.FinalIK namespace. :)

    Hope it helps,
    Pärtel

    That was just composed using the same package that you guys have, you can already do the same if you like.

    Thanks, but animation skills are still useful..just that with the interaction system, you can animate the object instead of the character :).
    For the demo, I animated the button and the door and the cigarette, and the effectors will just be pinned to those animated objects. Thats what drives it.

    Cheers,
    Pärtel
     
  10. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Yes it makes sense, thank you for the thoughts, I'll try to make it as modular as possible :)
     
  11. Rohac

    Rohac

    Joined:
    Dec 16, 2013
    Posts:
    3
    I was right then :)
    I did not had time to do this (working on a motorbike's physic) but the first time I see one of your demo in which you grab the hand of an avatar I was thinking "Wooow a nice way to open the fridge, take a beer and no need to create a custom animation for each beer !" This could seems stupid (or not ?) but that was one more reason for me to buy your package
     
  12. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Partel, Great work with FINAL IK!

    I have a question and please excuse my ignorance I'm more of a Modeler/Animator my programming Kung Fu is very week...

    Let's say I have two procedural animations set up between two sets of game objects and I have them driving my IK rig, can I transfer control from one to the other over time by maybe using the mouse wheel or setting up transitions through code, and expanding on that further is it possible to set up a random transition from one to the other if I have several?

    I hope this makes sense...

    I'd like to know this because I bought FINAL IK to help cut down the amount of animations I need to create for my game, Thank you Patel, I believe your plugin will be making my work a lot easier!!

    Kent
     
  13. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Thinking again... should stop it really XD

    It would be nice to slide weight up to a pose, then save that pose in some way, so that it becomes the "norm", and move the IK weights back to zero. So in effect we have rig + animation + pose. Leaving FBBIK free to allow us new IK positions for effectors from the new pose. With of course a feature to let us blend weight our way out of the pose back to just rig + animation.
     
  14. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Haha nice...

    Well I understand the concept, but not 'technically', but I think the nomenclature is what's throwing me off; we're using the term 'Target' interchangeably and overloading its meaning. We have the 'Target' for the actual aiming, but in other instances we have a 'Target' for the default direction for AimIK...hmmmm. Yea this is where it gets tricky.

    When aiming a gun, we merely need a target to 'look at', and the spine bones are rotated thusly to aim the 'Aim Transform', got it, no problem...

    ...but for melee anims, you have to use the 'pin' to, from what I'm guessing, retarget the entire structure of the upper body BEFORE applying the AimIK to allow the fist/sword hit the intended target. The code appears simple enough but I'm having trouble understanding why AimIK interferes with the Spine animation unless you simply add a default direction in script.

    It seems as if always having the option(in the Inspector) to set the 'default direction' for AimIK would be more desirable than not, since in both of your demos (Gun/Boxing), they BOTH aim/hit the intended target, yet one requires code and the other does not. Isn't the Boxing method superior to the Gun method, achieving the exact same functionality but with greater animation fidelity?

    I guess now we'll need some documentation explaining how we can access Final<IK in code, like the snippet you posted below...

    ...do you have a general ballpark when we can see code documentation, or at the very least where to look in the commenting of your code we have now, to learn how to do all the fancy fun trickery you've been putting in your demos? :D

    Also since we are technically beta testing this bad boy, is it possible to get some of the more raw functionality like the button-pressing/door-opening/cigarette-putting-outing video you just posted, sent to us to experiment with?

    All this said, I want to note how excellent you've been with support...rock on Partel.


    -Steven
     
  15. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    Hi Partel,

    I was having a bit of trouble with this script until I noticed you missed out raycastLayers at the end of this line ..
    Code (csharp):
    1. if (Physics.Raycast(worldPosition, Vector3.down, hit, raycastOffset.y * 2f, raycastLayers)) {
    Because I'd got some hidden colliders I didn't see, and was wondering why the hight of the hit was not changing in those areas .. :D

     
  16. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hi, Licarell, thank you, :)

    The IK effectors and all their properties, position, rotation, positionWeight, rotationWeight and so on are totally under your command. So you can indeed crossfade between different positions and rotations, it is entirely up to you.

    If I understood you correctly... :)

    You can actually do that if you just update FBBIK twice each frame :).

    Ahh, indeed you are right, sorry&thanks! :) I repaired it in the initial post as well.

    AimIK keeps an object rotated towards a direction, that's the only thing that it does. If we use it on a melee animation, it would keep the Aim Transform rotated towards a direction. Since the Aim Transform is the child of the last spine bone, it will keep the last spine bone rotated towards that direction as well. You can try to swing a punch at the mirror without moving your spine, and see how natural that looks ;)

    We can't use that same default direction logic with guns, because the gun itself is the Aim Transform and we can't just rotate it out of place before solving Aim IK, it would fall out of hand. Thats why I added a new GameObject to the spine to be the Aim Transform in the boxing demo and the tutorial, I can rotate it however I need without changing the ainmation. Try thinking of it this way: the arbitrary Aim Transform object is there to compensate for the animation of the spine. In the script we tell that object to look in the default direction so that AimIK would not have to bend any bones for it to look in the default direction.

    The code documentation has always been there: Here's the page for the solver of AimIK

    Thats a bone to chew, but I will start with the simple "setting started with scripting" first thing tomorrow, as it is clear, it would be most helpful to everyone including saving time for me on explaining.

    Sure, but I still need to get it to where I know I wouldn't have to change it too much anymore, just improve and add features. Otherwise you would already jump at it, build a lot on it and be really sad/pissed when I had to change something completely and your stuff gets broken with every update of Final IK..
    So please have patience. :)

    Thanks, man, thats good to hear.. There have been a ton of e-mails though, so If anyone hasn't received an answer within a day, just send again please, I might have just missed it. :) Luckily it's just questions though, I've only been pointed to 2 minor bugs so far :)

    Cheers,
    Pärtel
     
  17. Silly_Rollo

    Silly_Rollo

    Joined:
    Dec 21, 2012
    Posts:
    501
    Seems very bug free for a 'beta'. Just replacing the usage of Unity IK with Final IK components in my project already looks great and I've barely skimmed the surface of its potential with the more elaborate functionality.
     
  18. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    I suspect it's well deserved. ;)

    I shall be picking this up myself as soon as I've got my current wave of work behind me. Looking forward to it!

    Edit: Purchased. ;)
     
    Last edited: Jan 20, 2014
  19. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Thanks for the purchase AngryPenguin, let me know how you're doing :)

    I added code snippets to each component in the User Manual.
    If you feel I missed something important, let me know.

    Also I've uploaded the FAQ page, please also read this. :)

    Cheers,
    Pärtel
     
  20. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Oh, and I have an announcement to make..

    Final IK will go through some serious battle testing before the 1.0 release as I will start working with the PixelBeam team on their incredible looking game Storm United. I will be working on the animation controller, integrating it with my stuff and we'll find out how much exactly can be squeezed out of Final IK. :) This is good news for you, because according to the agreement, the extra functionality developed in the process can be included in the future releases of Final IK. :D So stay tuned for this as well..
     
  21. rcalt2vt

    rcalt2vt

    Joined:
    Jun 6, 2009
    Posts:
    36
    Very nice to hear, loving the package on my end. Makes the robots movement I'm working with feel awesome.
     
  22. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Thats great , rcalt2vt, thanks! :)

    How about the rest of you, it has been awfully quiet on the feedback and support e-mails, so are you guys doing OK or are you just banging your head against the wall and utterly confused about everything? I know there's a lot of you ;)

    Also it would be great to see what you are up to with Final IK, I can give you advice on how to improve things when I see something :)

    Cheers,
    Pärtel
     
  23. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    I can do that. :)

    I'm currently doing somewhat of a... feasibility test which will hopefully lead onto a bigger project. This IK stuff will be a pretty significant part of the overall project.
     
  24. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Thats great, Penguin, hope all goes well :)

    Just a thought.. If anyone here feels right at home with character animation and has done their homework with the Vectors and the Quaternions and wants to become an Asset Store Publisher, but doesn't have a solid idea yet... FBBIK opens up a whole new world of opportunities for you. That world is way bigger than I could ever imagine or fill on my own, so I want to encourage you to making your own plugins for the plugin. Here are just some of the thoughts that I have for you:

    - Procedural Climbing System - that's a no-brainer :)
    - Animation Customization System - set up the character with an animation, apply position offset and save the result as a new animation clip. Very simple and lots of people have been asking for this. That one has probably the most potential.
    - Driving rig with physics
    - Procedural Emotes
    - Mechanised Character System - something like the Mech Spider demo, but more generic. With collision testing, climbing the walls and ceilings and what not.
    - Realtime Animation Characterization - you could procedurally simulate fatigue, injured limbs, anxiety, laziness...
    - Procedural Damage System - something like the Hit Reaction demo, but again, maybe easier to set up, include some ragdoll physics maybe.
    - Environmental Awareness - cognition of the ingame geometry, grab corners, protect from incoming kinetic damage, put the head down in small head space, wind reaction, you name it..
    - Melee/Hand2Hand Combat System - think in the direction of EA's MMA
    - 3rd Person Free Aiming System - think Max Payne 3 style
    - Procedural Locomotion System - thats a tough nut...
    - Integration plugins to every 3rd party asset you can think of (Character System, all the AI packages, so forth, so forth...). Thats n*n pool of opportunities for you!

    And thats just a couple of ideas that I can think of at the moment.. All that can be achieved with just using the Final IK API, probably no need to dig deeper in the scripts. You can sell your plugin on the Asset Store and if there's enough demand for it to be fully integrated to Final IK, I'd be interested in buying it from you.

    I could hire people to start putting it all inside Final IK, but then it would quickly grow to be unaffordable to most and a lot of people would pay for a lot of extra functionality that they would never even use, so I guess it would be better to keep the extra stuff separate, so people could only pay for what they need and compose their own package of IK awesomeness :)

    If you want to start and are serious about it, let me know so I wouldn't (and inform others if they intend to) duplicate your work. I can also provide guidance and support for your effort.

    Cheers,
    Pärtel
     
    tr1stan likes this.
  25. rcalt2vt

    rcalt2vt

    Joined:
    Jun 6, 2009
    Posts:
    36
    Maybe a bit more documentation on extending the Final IK system?

    For example I've got a quadruped mech with each leg containing 4 segments (digitigrade) and I've really go no idea on the path I should take for extending the Final IK system at this moment. Granted I only briefly looked though the extending section of the docs due to mostly focusing on the terrain system. However the thought is that I should make a quadruped full body ik so all four feet can find the ground and the feet are angled according to the ground's normal.


    On a related note, your code is fantastically written, it brings a tear to my eye when I see another coder put that much effort into their work.
     
    Last edited: Jan 21, 2014
  26. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Hi, if you could show me a pic of the mech that you have in a PM, I could tell you what would be the best approach.

    And thanks for the compliment! :)

    @everyone, sorry for the delay with the next tutorials, I've been working on pimping the 3rd person demo in the new Standard Assets, so I could use it in the future demos and tutorials... :)

    Cheers,
    Pärtel
     
  27. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Gratz on the work battle testing FBIK :) Everything going well here - just eager for morsels of the new InteractionIK - like everyone, can't wait to get my hands on it.

    Been a lot of speculation of procedural motion - can't imagine how that could be done, but would need the footIK to work well. I've just about written my footIK using raycasts - but I don't think I'm going to attempt actual motion with FBBIK :)

    Great work so far, FBBIK is as solid as a rock
     
  28. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
  29. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    @neoshaman - There is interactionIK coming soon, which allows for pressing buttons, opening doors, etc. You can also open/close the hands pretty easily by modifying the fingers' transform rotations (this is fast and works very well). Being able to touch things (like in the video) is much harder, and would require using MeshColliders on everything, which would be horrible for performance... Maybe swapping ordinary colliders for meshcolliders if the the hand is near something is a possibility - it certainly would be nice to give the illusion of solidity to the world :)
     
  30. Tonmeister.

    Tonmeister.

    Joined:
    Mar 30, 2013
    Posts:
    27
    Hi Partel,
    Is there any other way to register into your support forums without having 3rd parties accessing email personal information? Some may find this appropriate, but I don't.

    thanks
     
  31. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    @whippets
    Yeah I'm aware, in generic game case the handIK is overkill. Game like the last of us is already doing the simple interactionIK like solution (touching wall).

    Imagine it in specific context with only specific interaction, maybe firing the "handIK" precisely when interacting with this kind of mesh that lie in a specific collision layer (for example when the hand gizmo enter a specific trigger volume (as you proposed) in which the mesh could be swapped in and out specifically for the interaction.

    But imagine a FPS where you can occasionally have "sensual" interaction with the world for immersion purpose (all interaction that aren't functional affordance like opening a door or flat surface). It would a great visual feedback for increased reality perception in games, especially with occulus rift.

    Maybe useful for adjusting the finger to adapt to object mesh (example procedural mesh) then deactivating the handIK once the object have the finger set on it. In the "Linking Effectors to Objects" we have to set the fingers it at edit time with hand IK we could do it at runtime.
     
  32. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    945
    Hi Partel i bought it, i'm enjoying it a lot, i put you 5 stars you deserve it :)

    Thanks!
     
  33. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Haha, I hadn't even seen that.. I suppose the IK part of this could be done with Final IK, but it looks like more of a IK/Physics hybrid.

    Compound colliders could also do the trick for most of the stuff and its no problem, I think, to only enable the ones closer to the hand as you said :)

    Sorry not at the moment, because it is some kind of a standard thing that you can drop in with Weebly. But actually that self-made excuse of a website is being remade and there's going to be another solution for support as well. In the meanwhile, please just use this thread or the e-mails or private messages.

    Btw, the next tutorial is done, just gonna take ages to upload, its 15 minutes of full HD :)
     
  34. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    And a big thank you to Kirby and everyone else here once again! :D

    Edit: The new tutorial is up!
    Its a bit more in depth on the Aim IK as requested and also shows how it can be combined with FBBIK and LookAt IK:



    and here is the commented code from the video:

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using RootMotion.FinalIK;
    5.  
    6. public class SecondHandOnGun : MonoBehaviour {
    7.  
    8.     // References to the IK components
    9.     public AimIK aim;
    10.     public FullBodyBipedIK ik;
    11.     public LookAtIK look;
    12.  
    13.     // Just quick shortcuts to the hand effectors for better readability
    14.     private IKEffector leftHand { get { return ik.solver.leftHandEffector; }}
    15.     private IKEffector rightHand { get { return ik.solver.rightHandEffector; }}
    16.  
    17.     private Quaternion leftHandRotationRelative;
    18.  
    19.     void Start() {
    20.         // Disabling (and initiating) the IK components
    21.         aim.Disable();
    22.         ik.Disable();
    23.         look.Disable();
    24.  
    25.         ik.solver.OnPostUpdate += OnPostFBBIK; // Add to the OnPostUpdate delegate of the FBBIK solver
    26.     }
    27.  
    28.     void LateUpdate() {
    29.         // Find out how the left hand is positioned relative to the right hand rotation
    30.         Vector3 toLeftHandRelative = rightHand.bone.InverseTransformPoint(leftHand.bone  .position);
    31.  
    32.         // Rotation of the left hand relative to the rotation of the right hand
    33.         leftHandRotationRelative = Quaternion.Inverse(rightHand.bone.rotation) * leftHand.bone.rotation;
    34.  
    35.         // Match AimIK target with the LookAtIK target
    36.         aim.solver.IKPosition = look.solver.IKPosition;
    37.  
    38.         // Update Aim IK. This will change the position and the rotation of the right hand that holds the gun, so we will need pin the left hand back to the gun handle
    39.         aim.solver.Update();
    40.  
    41.         // Position the left hand on the gun
    42.         leftHand.position = rightHand.bone.TransformPoint(toLeftHandRelative);
    43.         leftHand.positionWeight = 1f;
    44.  
    45.         // Making sure the right hand won't budge during solving
    46.         rightHand.position = rightHand.bone.position;
    47.         rightHand.positionWeight = 1f;
    48.         ik.solver.GetLimbMapping(FullBodyBipedChain.RightA  rm).maintainRotationWeight = 1f;
    49.  
    50.         // Update FBBIK
    51.         ik.solver.Update();
    52.  
    53.         // Rotate the head
    54.         look.solver.Update();
    55.     }
    56.  
    57.     // Rotate the left hand after FBBIK has finished, called by the FBBIK solver
    58.     private void OnPostFBBIK() {
    59.         leftHand.bone.rotation = rightHand.bone.rotation * leftHandRotationRelative;
    60.     }
    61.  
    62. }
    63.  
    In the video I used InverseTransformDirection instead of InverseTransformPoint, please excuse this stupidity :)

    I hope it will be helpful,
    Pärtel
     
    Last edited: Jan 22, 2014
    Ghosthowl and JosephSavior like this.
  35. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    I'd like to offer, for a fee, a protection service. Me and the boys will be your personal bodyguards... which you may well need once the Animators Union put a contract out on you. They're paying quite a lot, I hear.
     
  36. hamyshank

    hamyshank

    Joined:
    Jan 31, 2013
    Posts:
    88
    that tutorial is really informative, thanks for posting it.

    i know you've eluded to this in your past posts, but can you elaborate more on what you're doing with the new third person controller? the demo scenes are great, but just moving the handles in the scene view doesnt really explain very much on how this can be implemented in game (at least for me). can we get a demo scene with an actual working third person controller with the aimIK already set up? nothing fancy of course, just to be able to move around using the controller and aiming with the mouse (not the handles in the scene view)
     
  37. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Haha, thank you, Don Whippets, for your concern :D

    Thats exactly what I am working on as we speak. I just had to rework the 3rd person demo of the new Standard Assets to better fit my requirements.
    You can try my version here: http://www.root-motion.com/demos/Custom3rdPersonController.html

    I needed it to preserve velocity while turning, not grind to a halt when you try to take a 90 degree corner while running.. and some other minor adjustments. You can try the original to see what I mean. It is using the exact same AnimatorController.
    Now that I have the base 3rd person controller, I can start adding aim and everything else. The other one that I had with the Dummy was using Legacy, I want to make a humanoid one that you can use right out of the box for your own characters, but I got to run down some Mecanim brick walls first :)

    Cheers,
    Pärtel
     
  38. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Hmmm, be interesting to see where you go with the 3rd person controller. I use left-mouse-hold = rotate avatar, right-mouse-hold = free look, and both-mouse-button-hold = move forward, and of course collision altering zoom/distance to stop the cam going through objects. But there's all sorts of tailored ones for various games - what direction are you aiming for? Is it tied in with F-IK?

    Don Whippets XD
     
  39. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    The demo has no IK yet, but with the aiming, I will probably go the same way as in this video.
     
  40. Tonmeister.

    Tonmeister.

    Joined:
    Mar 30, 2013
    Posts:
    27
    for anyone looking to move the aimIK target via a game object here's a small script. I'm creating a 2d game, so it only needs to move up and down. The game object is parented to the character so it moves and rotates as the character does,

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using RootMotion.FinalIK;
    5.  
    6. public class AimLink: MonoBehaviour {
    7.  
    8.     public AimIK aimIK;
    9.  
    10.  
    11. void Update() {
    12.  
    13.         if (Input.GetKeyDown(KeyCode.UpArrow))
    14.  
    15.         {
    16.             transform.position += Vector3.up;
    17.         }
    18.        
    19.  
    20.         if (Input.GetKeyDown(KeyCode.DownArrow))
    21.  
    22.         {
    23.             transform.position += Vector3.down;
    24.         }
    25.  
    26.         aimIK.solver.IKPosition = transform.position;
    27.  
    28.     }
    29.  
    30. }
    cheers
     
    Last edited: Jan 23, 2014
  41. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    bough it, supporting development!

    a bonetarget manager would be a good thing.

    ok, so I noticed there's no mecanim demo for aim IK, started today setting up my mecanim bipeds, but still at optimize game object (w/out wont run), have to expose all joints and set them in hierarchy, and IK. [apply root motion also no good in animator]. so keep fingers crossed

    no, its not bending, but the bones are assigned in bipedIK
     
    Last edited: Jan 23, 2014
  42. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    So wait, there are issues with Mecanim? This is kinda 'not good'... :confused:
     
  43. Silly_Rollo

    Silly_Rollo

    Joined:
    Dec 21, 2012
    Posts:
    501
    What's the issue? I have an extremely complex mecanim character I'm using with both Aim IK and FBBIK. I used the Aim, Motion Absorb, Boxing, and Hit Reaction demos as reference to build in Final IK into my combat system. It is working really well. I use Aim so that my range weapons point their weapons towards the crosshair smoothly regardless of how the animation is oriented.
     
  44. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Good to hear. I haven't gotten around to implementing Full>IK on my characters(Mecanim) yet.

    It gets a bit disconcerting when I read that there may be issues with Mecanim, as it's already been a source of headaches (outside of Full>IK) for many people (including myself), considering how utterly invaluable it is otherwise. :D
     
  45. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    had some bone assignment issue but this looks all right to mi. set the solvers position weight to 1, still not following animation
     
  46. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    No there's nothing wrong with using Mecanim and Final IK. What I meant by brick walls is the general limitations of Mecanim that we have with or without FinalIK, you know the problems with accessing stuff and so forth...just general animating stuff.

    What do you mean by apply root motion not good in animator? But it seems like something weird is going on, so if you could send me the character and/or provide more information, I could help you out.

    Cheers, Pärtel
     
    Last edited: Jan 23, 2014
  47. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Ok, what happens if you weigh in the effectors?
     
  48. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    for my rigged fbx if rootmotion is applied the whole mesh shakes n turns.

    fullbody IK, effectors maxed


    I have to weed out the unitypackage, a simple .unity file is unusable right
     
    Last edited: Jan 23, 2014
  49. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Maybe you are running away with effector weights on? Effector positions are defaulted to where their bones are at Start(). So if your effector(s) are weighed in, and you run away they will be left behind and when the character gets very far, you will get this shaking/turning effect, because the pull from the effector gets really strong..

    You have to tell the solver where you want the effectors. If you don't need to use an effector, leave it's weight to 0
     
  50. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,554
    Yes, please export a package and send me via PM or support@root-motion.com.
    I'll get that sorted out for you ASAP :)

    Pärtel