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

    Khai3

    Joined:
    Aug 13, 2018
    Posts:
    16
    I managed to find another character and got that to work so I think I am fine now. Thank you for the kind offer tho!
     
  2. Partel-Lang

    Partel-Lang

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

    This issue happens when in the animation the leg is almost straight, but still bent slightly in the wrong direction (sideways or backwards) due to bad Humanoid retargeting usually. FBBIK tries to maintain the animated bending direction so if the leg is not straight anymore due to IK, it becomes visible. There are some solutions for this:

    Enable "Foot IK" for all the locomotion states in the Animator to improve retargeting quality.
    If that doesn't work, go to the avatar configuration scene and rotate the knee bones to make legs a bit more straight. That causes the retargeting to have an opposite effect and keep the legs slightly more bent.

    Best,
    Pärtel
     
  3. Oyshoboy

    Oyshoboy

    Joined:
    Jan 6, 2017
    Posts:
    20
    Thanks for reply! But I'm using a particle collision detection, it's a default method called "OnParticleCollision", How should I figure in that case?
     
  4. tspk91

    tspk91

    Joined:
    Nov 19, 2014
    Posts:
    131
    Hi, what would be the best solver for a pilot inside a cockpit? We have been using FullBodyIK but want to be sure we are using the best option for optimization purposes. Our game supports VR, so we need torso and arms movements. Hand poses are predefined holding the flight controls, and the legs are static.
     
  5. Michael2790

    Michael2790

    Joined:
    Nov 27, 2017
    Posts:
    10
    Hi Partel
    I am working on the 2 handed pick up and using your demo example.When I shoot ray cast to the object I want to pick and start the interaction.The interaction picks up multiple prefabs of that object in the game scene(all the prefabs of that game object lerps to that hold point).I only want to pick up one at a time.It looks to me that the hold point might be what is causing the issue.Maybe is because all the whole instances of that game object I want to pick is sharing the same hold point. How can I fix that problem in order to pick one object?
     
  6. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    You could instead of raycasting directly from that, raise a flag and perform the raycast in LateUpdate if said flag is raised.

    Or the other option would be to change when Final IK updates by disabling the ik component and calling ik.solver.Update() whenever you need. Just has to be after the Animator update.

    If you were using "Animate Physics" update mode, you could disable the Animator, IK, and call animator.Update(Time.deltaTime) and ik.solver.Udpate() from FixedUpdate.

    Hey,
    If it's VR, then VRIK would be the thing to use. There is a seated example in the "VRIK (Basic)" demo and VRIK is much faster than FBBIK. If you don't need the head positionally tracked though, you could just use simple BipedIK, that would be the fastest.

    Hey,
    Sorry, not sure I understood the problem. When I go to the "Interaction Pick Up 2-Handed" demo and just duplicate the sphere, I can choose which one to pick up by just replacing the "Obj" in the PickUpSphere component.

    Best,
    Pärtel
     
    Oyshoboy likes this.
  7. Oyshoboy

    Oyshoboy

    Joined:
    Jan 6, 2017
    Posts:
    20
    Thanks! It's hepled!
     
  8. unity_-uJ7T8BjJWZrvg

    unity_-uJ7T8BjJWZrvg

    Joined:
    Mar 26, 2018
    Posts:
    5
    I'm trying to get my character to hold an object with two hands. So I've used left and right hands interaction targets, but the hands are crossing over when the character tries to pick the object from the other side.
    Has anyone faced the same issue? please let me know. I'm stuck here.
     
  9. rotsin

    rotsin

    Joined:
    Feb 22, 2013
    Posts:
    15
    Hi Partel,

    Just installed 1.8 and had a question related to how to set up aim ikj. I opened the aim ik scene, commented out all the scripts, added aimikj and copied the settings from the old aimik script. The problem is that the old script relies on the laser beam of the rifle as the aim transform, doing that in the new script throws the "The TransformStreamHandle cannot be resolved". I suspect this is because the mp-40 is not included in the dummy character avatar and by extention it's animator. If I use the hand as the aim transform it's going to be way off target. Do you have a sample scene set-up for aimikJ or some hints on how to move forward?

    Thank you!
    Andrei
     
    Last edited: Nov 10, 2018
  10. Michael2790

    Michael2790

    Joined:
    Nov 27, 2017
    Posts:
    10
    Hi Partel
    I attached the PickUp2Handed script to the interaction object .However when i duplicate the object and click on start interaction, multiple interaction object are picked up.I only want to pick up one at a time and am using ray cast hit to get the info of the object I want to pickup but it is not working for me.I end up picking multiple object.It work pretty well for the
    Interaction System Part 2 but cant get it to work for 2 handed pickup.I need to find a way to send message to the game object am picking up or do you think it will be better to attached the PickUp2Handed script to the player and get the component of the object i have interacted it to prevent multiple pick ups.
     
  11. saharaseeri

    saharaseeri

    Joined:
    Jul 1, 2017
    Posts:
    11
    Dear Partel, I used VRIKCalibrator.CalibrationData and it works great with one of the object, but when I tried to used another avatar that I made with auto rigging maya it worked; however, the avatar scaled up and became huge. I was standing when I did the calibration and in same position of the object. also the two Palms when I rotate them they became small and look like 2D. Any ideas how to solve these problems...
     
  12. saharaseeri

    saharaseeri

    Joined:
    Jul 1, 2017
    Posts:
    11
    Dear Partel, I used VRIK Calibrator script and it works great with one of the object, but when I tried to used another avatar that I made with auto rigging maya it worked; however, the avatar scaled up and became huge. I was standing when I did the calibration and in same position of the object. also the two Palms when I rotate them they became small and look like 2D. Any ideas how to solve these problems...
     
  13. PixelPounder

    PixelPounder

    Joined:
    Feb 11, 2014
    Posts:
    56
    I'm just recently purchased 2 character controllers (Opsive's Ultimate Controller and ootii's Motion Controller)... both are excellent but regardless of the player model and the weapon model... the hands and weapon position is always off ie. when the player is holding the weapon... the butt stock isn't in the right place on the shoulder... or the front hand is too far up on the upper receiver... or the trigger hand isn't on the grip right... or the angle between the front and rear hands is off, etc. etc. That's not the fault of those character controllers... it's just what happens when you have models and weapons not specifically made for each other.

    I was going to use Umotion Pro, which is also an excellent asset to fix the animations but I'm thinking it may not be the right tool for this particular job... as I think this is an IK problem and not an animation problem... although Umotion Pro does fix IK issues in animations... I don't think it's the core thing it does... or perhaps I'm just not good enough with it yet - lol.

    Anyways, can Final IK easily fix the issue I outlined above... and would I have to fix every animation that uses the rifle... ie. rifle idle, rifle strafe right, rifle shooting, rifle strafe left, etc. or Final IK fixes it in the model itself and not the animation... and the animations just end up working because the model was "fixed?" Thanks.
     
  14. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    Please see the "Interaction Pick Up 2-Handed" demo, it has a script that rotates the pivot of the hand targets to towards the character when the interaction starts.

    Hey,
    You should not have the PickUp2Handed script on both interaction objects. It should be on it's own gameobject and you only need to replace the "Obj" field of it. Set it to the interaction object that was found from the raycast hit.

    Hey,

    The IK jobs are currently as experimental as are the AnimationJobs that they use. Aim Transform having to be a bone of the avatar is one of the current limitations (can't use TransformSceneHandles as they are treated independently, not as members of the bone hierarchy). Also, AimIKJ supports only RotationLimitHinge and RotationLimitAngle as other limits use properties that can not be handled by the Animator. To use bone weights, you'll have to add the IKJBoneParams component to the bones. Those are the only known differences so far.

    I'd advise you to keep using AimIK until AnimationJobs and AimIKJ matures. I added AimIKJ and CCDIKJ in mostly to get some feedback and learn about the possible use cases from my client base (So thanks for the feedback!) There is currently no performance gain unless you need to use the IK on a crazy number of characters. In fact, AimIKJ is considerably slower than AimIK if used on a small number of characters. I'm in contact with the Unity devs about all this and they're trying to figure out that performance issue.

    Hey,
    Did you try to use the calibration data from one character to calibrate another character? Calibration data can only be used to recalibrate the same character to the previously calibrated data.

    Hey,
    If the front hand is off, that is quite easy to fix with IK. You just add LimbIK or ArmIK to that arm, and you can offset the arm relative to the weapon like this:

    Code (CSharp):
    1. void LateUpdate() {
    2. ik.solver.IKPosition = ik.solver.bone3.transform.position + otherHand.rotation * offset;
    3. }
    So you add offset relative to the rotation of the hand that is holding the weapon. You can store the offset values for each weapon and switch between them as you switch weapons.

    If the trigger hand is not on the grip right, you should be able to just adjust the localPosition/Rotation of the weapon as it's parented to the trigger hand. If it's the trigger finger that is off, you can just add some rotation offset to the trigger finger bone in LateUpdate:

    Code (CSharp):
    1. public Vector3 triggerFingerOffset;
    2.  
    3. void LateUpdate() {
    4. triggerFinger.localRotation = Quaternion.Euler(triggerFingerOffset) * triggerFinger.localRotation;
    5. }
    You can do the same with the front hand bone if the angle between the front and rear hands is off.

    If the butt stock isn't in the right place on the shoulder, it's a bit trickier issue. You might want to try using FullBodyBipedIK to offset the shoulder effector (see the "Effector Offset" demo).

    Cheers,
    Pärtel
     
  15. PixelPounder

    PixelPounder

    Joined:
    Feb 11, 2014
    Posts:
    56

    Thanks for the reply... so it's done through code and not visually on both accounts - ie. front hand and rear hand?

    And in your code above for the front hand... where is it getting the values from to move the arm? Through code? And where does that code get put... in a script on the character?

    In terms of the trigger hand... just moving the weapon around doesn't sometimes work... the entire arm may be too high or too far forward, etc... the entire arm, including forearms and hands need to be adjusted... can IK do that... and is it done visually or done via code?

    I would imagine, based on the various forums out there that have gone through... that a lot of people have issues matching up their model to the weapon and getting the hands/arm positioning right... do you have any video showing how to fix this specific issue?
     
  16. benthroop

    benthroop

    Joined:
    Jan 5, 2007
    Posts:
    263
    Hi Partel - we love your stuff. Question!

    We have a character flying through the air using an unpinned Puppetmaster setup. We want to control his limbs using Final IK. The effectors for the Final IK (we're using Full Body IK) are staying back at the blue wire representation that Puppetmaster renders and we are operating on the character in his actual position flying through the air.

    So my question is, is there a convenient way to transform a point in world space from the Puppet space back to the blue wire space? We want to have a "virtual effector" that we can drag around in Puppet space. Hope that makes sense.
     
  17. iklw1115

    iklw1115

    Joined:
    Nov 14, 2018
    Posts:
    15
    Hi Partel,
    Thank you for making wonderful things.

    I am creating a multi-network game using VRIK.
    I was creating it while watching a tutorial posted on youtube, but it did not go well.
    I also saw the past question answers.
    However, although I tried it a lot, I can not move it on the network.
    May I tell you in detail how to do it in detail.
    I'm sorry, please.
     
  18. unity_-uJ7T8BjJWZrvg

    unity_-uJ7T8BjJWZrvg

    Joined:
    Mar 26, 2018
    Posts:
    5
    Hey, I checked the demo, the problem is that for different positions from where players pick the object, the holdpoint's
    orientation needs to be different.
     
  19. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    Here, I made a quick demo for you. Please find the WeaponHoldOffset component on the Dummy, play the scene and switch the "Current Weapon Index" between 0 and 1 to see how the weapon holding changes, then try and play around with the values in the "Weapon Params" to understand what they do. WeaponHoldOffset is just a few lines of code so it should be quite easy to add additional bone offsets should you need to.
    So you can just create WeaponParams for each weapon you have (adjust the values while playing, then copy component from play mode, stop play mode and paste the component values back so you don't lose your adjustments.

    Hey,
    Yeah:
    Code (CSharp):
    1.  public static Vector3 MuscleToTargetSpace(Vector3 position, PuppetMaster puppetMaster)
    2.         {
    3.             return MuscleToTargetSpace(position, puppetMaster.muscles[0]);
    4.         }
    5.  
    6.         public static Quaternion MuscleToTargetSpace(Quaternion rotation, PuppetMaster puppetMaster)
    7.         {
    8.             return MuscleToTargetSpace(rotation, puppetMaster.muscles[0]);
    9.         }
    10.  
    11.         public static Vector3 MuscleToTargetSpace(Vector3 position, Muscle muscle)
    12.         {
    13.             return muscle.target.TransformPoint(muscle.transform.InverseTransformPoint(position));
    14.         }
    15.  
    16.         public static Quaternion MuscleToTargetSpace(Quaternion rotation, Muscle muscle)
    17.         {
    18.             return muscle.target.rotation * (Quaternion.Inverse(muscle.transform.rotation) * rotation);
    19.         }
    Hey, yeah no problem, what exactly were you having trouble with?

    Hey,
    Yes, that's exactly what the demo does. I mean if you move the dummy to the other side of the box or sphere and turn it around, it will still be able to pick up the object properly.

    Cheers,
    Pärtel
     
    PixelPounder likes this.
  20. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hello! I recently bought rift, and realized that hey I have final IK :D YEEE!! So, I set it up my character with VRIK component and followed your tutorial by using it with steam vr..

    So the first problem is that something is weird with the camera rig I dragged from steamvr folder, I assign everything right, but the "vr camera" was at Y 0 but I could look around... and my touch controllers didnt work I think.. They only felt the "oculus grid" if you know what I mean...

    So I ended up using the Player prefab from the steam new interactable object scene, but hey I got interaction!
    Now when I followed your tutorial everything worked! but...

    1. My hand wrists allways is somehow twisted if I rotate my hand wrist in real life, shouldnt the arm must rotate a bit too form the hand to the elbow?Like it does for real, or how can I fixed this "Unaturally twisted "joint" " .. ? I tried rotate it and arrange it like you did, but didnt solve the unaturally look...

    2. If I want steam vr to use my character hands for default pose and grip, push etc animations, how do I get some life in the hands?

    Thanks,

    Mattis
     
  21. PixelPounder

    PixelPounder

    Joined:
    Feb 11, 2014
    Posts:
    56
    I assume I would need to own FinalIK to make this download work. My question was a "pre-sales" question as I'm looking for a solution for a problem that I think a lot of folks have - making player models they buy work with weapons they buy in terms of hand placement and positioning and such... so the animations of when the player is firing or whatever movement... looks right. I do appreciate the response / reply though... thanks for your time.
     
  22. unity_-uJ7T8BjJWZrvg

    unity_-uJ7T8BjJWZrvg

    Joined:
    Mar 26, 2018
    Posts:
    5
    Got it! Thanks.
     
  23. iklw1115

    iklw1115

    Joined:
    Nov 14, 2018
    Posts:
    15
    Thank you.
    I have created three game objects (head, left hand, right hand) under the player object.
    I heard that HMD and controller's translate will be reflected in that game object.
    I am proceeding in that way and now it is running locally.
    However, if you try to play multiplayer on the network, the players will overlap and will not move accurately.
    I am creating it using UNET because it is only necessary for 2 or 3 people.
    Checking isLocalPlayer is done but it does not work.
    How can I solve it?
    It may be a question not directly related to FinalIK.
    I'm sorry...
     
  24. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    1. Please try adding the TwistRelaxer to the forearm or forearm roll bones if you have them. See the "VRIK (Twist Relaxer)" demo.

    2. Best way to do those finger animations would be to use finger animation and run them with Mecanim. If you don't have finger animation, you can create them in Unity using the Animation Window. You can add Animators to the hand bones and create the clips only for the fingers like that.

    Oh, sorry I thought you already had it, but this is how the scene looks like so you understand better.

    Hey,
    I'm not that good with UNet, I've mostly used Photon, so I can't really guess what might be going on there. What you should focus on is just getting the head and hand positions synced. You can temporarily remove all VRIK to not let it complicate things and confuse you and just see if you can get the HMD and hands synced right over the net. Should be lots of tutorials out there about syncing transforms over UNet. Once you have that done, just add VRIK back in, assign the targets and you should be set.
    I guess I should make a UNet demo for VRIK, I'll add that to my todo list...

    Cheers,
    Pärtel
     
  25. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Okay.. if I use mechanim I have to use the avatar mask? and if I create my clips in the animation window I just need to add the animator to hands?
     
  26. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    If you already have some hand animations of you can find some humanoid hand animations for VR in the Asset Store, then use the avatar mask. If you wanna try creating the hand animations in Unity, then add an Animator to the hands and use the Animation Window to create clips for those animations. Oh and use another instance of the character to create the animations, you'll probably mess up the original hand poses if you're new to the Animation Window.
     
  27. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Thanks for the tip to use a copy of the character to make the animations, its quite easy to mess up, hardest part is to get them to loop smoothly. Yea I figured them out, realized I could use brekel v2 for kinect to make animations.. It takes for ever to animate key by key. I prefer Akeytsu to do my animtions in, and then mocap the whole body.. Precuption Neuron is on santas list :D

    Anyway, if I want to controll my character with touch controller stick, can i somehow make the walk/run animation to override the head tracking foot placement and still use foot placement with head tracking when a gamer decide to walk in the play area to some object that is nearby?
     
  28. PixelPounder

    PixelPounder

    Joined:
    Feb 11, 2014
    Posts:
    56
    Quick question on this... (I don't have Final IK yet but will get it and check out the demo you made - thanks for that)... would I be able to have it so the hands/position relative to the rifle can change based on the animation? ie. the player's hands/position on the Rifle run are this... but on the Pistol walk... they are that?
     
  29. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    And also, I had to make the character Generic or else he would fall thrue the floor when applying animations.
     
  30. h00man

    h00man

    Joined:
    Apr 17, 2017
    Posts:
    54
    hey partel
    i'm trying to make a simple food ik for my humanoid character to make him able to climb up stairs.i used a capsule collider a rigidbody with freeze rotation constraints checked and full body ik and a grounder ik on the same gameobject.i used a simple animator with only 2 animations ,walk right and left.and when press a A and D keys i add force to rigidbody to make it move only left and right. the problem is that my character can't climb up stairs. his feet actually can predict the height of the stairs and they are doing well .but the capsule collider can't just slide up the stairs.
    by the way what does "IK pass" do in the animator layers? should i check them?
     
  31. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    I just got to say that ”daamn i hate unitys capsule colliders n S***” Im waiting for the skinnedmesh collider... Delete your colliders and make many colliders instead formed around legs arms body and head..
     
  32. iklw1115

    iklw1115

    Joined:
    Nov 14, 2018
    Posts:
    15
    We managed to synchronize the three objects.
    Thank you for giving a brief tip.
    However, when other players connect to the network, the model will move freely.
    Why is this?
    Is it my problem with network synchronization?
     
  33. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    Yes, you can just blend ik.solver.locomotion.weight to 0 when you want to move by thumbstick and then use animation to move the legs. Or you could create fully animation based locomotion. In that case you'd need a strafing blend tree for the locomotion and just make it follow the horizontal direction towards the HMD, move the character by root motion and/or script.

    Hey,
    Tecnhically yes, just like you change the hand positions by weapon, you can change them by animation. But it would have to be custom scripted of course.

    Hey, was that with the new Animators on the hand bones or did you use the existing Animator on the root?

    Hey,
    "IK Pass" in the Animator is not used by Final IK, that is Unity's own basic IK that works with the Humanoids only. If "IK Pass" is enabled, you can use OnAnimatorIK in a script on the same gameobject as the Animator to set it's IK weights and target positions.

    The Grounder of Final IK won't make your character controller walk up the stairs. It is just a vertical foot placement and alignment correction system that works on the bone level, so it doesn't intervene with your character controller.
    If the capsule is not able to slide over the stairs, it's usually because the capsule is too narrow and it's bottom doesn't have anough radius to slide over the stairs so it gets stuck. So try to increase the radius as much as possible. If you can't because you still need to be able to get close to the walls and stuff, then there is also the possibility to add an additional bigger sphere collider just for the ground. That collider should only collide with the ground layers, not the wall or any other layers.

    Hey, sorry, what exactly did you mean by the model moving freely when other players connect?

    Best,
    Pärtel
     
  34. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    197
    Hey @Partel-Lang

    I know this is going to be difficult to give an exact answer and the issue is likely caused by something in my project but I thought I'd post anyways. We have an NPC in one scene that uses LookAtIK and looks directly at the camera, perfectly. We copied that NPC to another scene (at different position/rotation), now the LookAt always seems to be over the players left shoulder. Any idea what would cause this? It seems that when the player is standing to the NPC's left, the look at is OK, but when the player moves to the right side of the NPC he stares far away.

    Cheers,
    Colton
     
  35. iklw1115

    iklw1115

    Joined:
    Nov 14, 2018
    Posts:
    15
    It was possible to synchronize on GameObject on the net reflecting the movement of HMD and Controller.
    However, assigning that GameObject to VRIK makes the model always in motion like an afterimage.
    Each time it moves it will return to the position where the position should be updated and if you do not move it will go somewhere.

    And then. . .
    Since I was also advised by other people, I started developing at Photon at the same time.
    If there is anything you do not understand please let me ask a question.
    I hope to create it with both Unet and Photon.
    How can I do with Photon?
     
    Last edited: Nov 20, 2018
  36. saharaseeri

    saharaseeri

    Joined:
    Jul 1, 2017
    Posts:
    11
    Hey,
    I just used the VRIK calibration for one character and it was working great without it become large. After that I did the same steps for another character and it work but the avatar became so big.
     
  37. PixelPounder

    PixelPounder

    Joined:
    Feb 11, 2014
    Posts:
    56
    I did just purchase Final IK... I see what you're talking about in terms of the values and such. Now, how would I assign these settings to each different weapon... ie. have his hands for an AR15 here... for another rifle there... etc.

    Also, will the new hand position be affected by the animation of him shooting?

    Finally, I went through the videos you have and didn't see one that was dedicated to Limb IK... I see it briefly mentioned in a video or 2 but nothing in depth... do you have one... specifically about hand positions and rifles... as I know a lot of people have challenges with that? I assume limb IK is the best process to use for this?
     
  38. Partel-Lang

    Partel-Lang

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

    How is the GameObject that LookAtIK is on, rotated relative to the head?

    I mean if you select the LookAtIK gameobject in the Editor while not playing, is the blue axis pointed towards the direction the character is looking at by default?

    LookAtIK samples the rotation of the head relative to the gameobject it's on (it's usually on the root of the character) to find out the axis of the head bone that is facing forward, so if LookAtIK gameobject is rotated in some other way than blue forward and green up, you might get weird issues like this.

    Hey, sorry, I cant think of anything based on that info. Could you please make a video or something and PM me.

    Hey,
    Do you have the latest Final IK (v 1.8)? There was an issue in the previous one with calibration size when you calibrated more than once, but it should be fixed now.

    Hey, thanks for the puchase!

    So you should extend the "Weapon Params" array to as many weapons as you have. Then play the game, switch between the weapons and adjust the offsets in the weapon params that you want to associate with the weapon (switch "Current Weapon Index"). When you are done, right-click on the component header and Copy Component, stop play mode, right-click again and "Paste Component Values" so you don't lose your adjustments. Then you just need to make a little script that sets WeaponHoldOffset.currentWeaponIndex to the index of the weapon that is currently being held.

    The script applies IK offsets to the animation, so yes, the new hand position will be affected by the shooting and reloading animations.

    I don't have a video for LimbIK, but here's the User Manual page about it.

    Best,
    Pärtel
     
  39. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    197
    Yes blue is forward and green is up on the LookAtIK object, would it be possible to send you a build of the demo scene (NPC is at the beginning)? If so would you prefer it on Oculus or Vive?

    Cheers,
    Colton
     
  40. iklw1115

    iklw1115

    Joined:
    Nov 14, 2018
    Posts:
    15
    I was aware.
    We will create and send a video of the current situation.
    But I do not know how to send private messages to you.
    How can I do it?
     
  41. TheDeepVR

    TheDeepVR

    Joined:
    May 8, 2018
    Posts:
    22
    Hi, @Partel-Lang !
    We are using VRIK and have created the script to magnet a hand to a gun when the hand collides with the gun in the specified positions e.g. grip and handguard.
    The issue here, that after some time of playing with such magnets the head of the model starts to rotate upward and doesn't follow the target but the body/spine continues to follow the head target rotation and position. The more we are playing the more the head rotates upward and finally literally moved inside the body.

    Please find screenshots with magnet and without magnet with the selected head target below.

    Here the magnet code. The suspicious moment here that we frequently replace VRIK.solver.leftArm.target and also call VRIK.solver.Update().

    Code (CSharp):
    1.     public class HandMagnet : MonoBehaviour {
    2.         public Transform RightHandContactPoint;
    3.         public Transform LeftHandContactPoint;
    4.      
    5.         private const float UnmagnifyThrottle = 0.4f;
    6.  
    7.         private bool _isLeftHand;
    8.         private SteamVR_TrackedObject _currentHand;
    9.         private Transform _currentTarget;
    10.         private VRIK _currentVRIK;
    11.  
    12.         private float _lastUnmagnifiedTime;
    13.  
    14.         private void OnTriggerEnter(Collider other) {
    15.             OnTrigger(other);
    16.         }
    17.  
    18.         private void OnTriggerStay(Collider other) {
    19.             OnTrigger(other);
    20.         }
    21.  
    22.         private void OnTriggerExit(Collider other) {
    23.             if (_currentHand == null) {
    24.                 return;
    25.             }
    26.  
    27.             var trackedObject = other.GetComponentInParent<SteamVR_TrackedObject>();
    28.          
    29.             if (trackedObject != _currentHand) {
    30.                 return;
    31.             }
    32.  
    33.             _lastUnmagnifiedTime = Time.time;
    34.         }
    35.  
    36.         private void FixedUpdate() {
    37.             if (_currentHand == null || Time.time - _lastUnmagnifiedTime < UnmagnifyThrottle) {
    38.                 return;
    39.             }
    40.  
    41.             if (_isLeftHand) {
    42.                 _currentVRIK.solver.leftArm.target = _currentTarget;
    43.             } else {
    44.                 _currentVRIK.solver.rightArm.target = _currentTarget;
    45.             }
    46.  
    47.             _currentVRIK.solver.Update();
    48.  
    49.             _currentHand = null;
    50.             _currentTarget = null;
    51.             _currentVRIK = null;
    52.         }
    53.  
    54.         private void OnTrigger(Collider other) {
    55.             if (_currentHand != null) {
    56.                 return;
    57.             }
    58.  
    59.             var trackedObject = other.GetComponentInParent<SteamVR_TrackedObject>();
    60.          
    61.             if (trackedObject == null) {
    62.                 return;
    63.             }
    64.  
    65.             var player = trackedObject.GetComponentInParent<Player>();
    66.  
    67.             if (player == null) {
    68.                 return;
    69.             }
    70.  
    71.             _currentVRIK = player.GetComponentInChildren<VRIK>();
    72.  
    73.             if (_currentVRIK.solver.leftArm.target != other.transform &&
    74.                 _currentVRIK.solver.rightArm.target != other.transform) {
    75.                 return;
    76.             }
    77.  
    78.             _currentHand = trackedObject;
    79.             _currentTarget = other.transform;
    80.             _isLeftHand = _currentVRIK.solver.leftArm.target == other.transform;
    81.  
    82.             Transform contactPoint;
    83.             Transform handMagnifierTarget;
    84.  
    85.             if (_isLeftHand) {
    86.                 _currentVRIK.solver.leftArm.target = LeftHandContactPoint;
    87.                 contactPoint = LeftHandContactPoint;
    88.                 handMagnifierTarget = _currentVRIK.references.leftHand.gameObject.GetComponentInChildren<HandMagnifierTarget>().transform;
    89.             } else {
    90.                 _currentVRIK.solver.rightArm.target = RightHandContactPoint;
    91.                 contactPoint = RightHandContactPoint;
    92.                 handMagnifierTarget = _currentVRIK.references.rightHand.gameObject.GetComponentInChildren<HandMagnifierTarget>().transform;
    93.             }
    94.  
    95.             contactPoint.localPosition = Vector3.zero;
    96.             _currentVRIK.solver.Update();
    97.             contactPoint.Translate(contactPoint.transform.parent.position - handMagnifierTarget.position, Space.World);
    98.  
    99.             _lastUnmagnifiedTime = float.MaxValue;
    100.         }
    101.     }
    Screenshot 2018-11-23 at 17.19.32.png withoutmagnifier.png
     
    Last edited: Nov 23, 2018
  42. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    I don't think a build would be of any use, I mean I can't see under the hood. Would it be possible for you to isolate the issue with just the character and the LookATIK on it and send it to me as a unitypackage?

    Hey,
    Click on my profile and select "start a conversation" or something like that... or just drop me an email to support@root-motion.com please.

    Hey,
    Not sure exactly, can't spot it from the code, but you are calling VRIK.solver.Update way too much. It needs to run just once per frame (usually in LateUpdate once you have set all it's targets). You are calling it in FixedUpdate and also from OnTrigger, which may be called from OnTriggerEnter/Stay multiple times per frame, so the problem might be that VRIK runs more than once per frame and thus solves additively on top of it's own results, not on top of animation or the default pose if you have no animation.

    Also, you have a lot of unnecessary GetComponentInChildren calls. Just in terms of performance, it is best to avoid it as it has to perform a depth search and a GetComponent on each gameobject in the hierarchy until it finds what it's looking for. You can store a reference to the VRIK in the Player class and use player.ik instead of player.GetComponentsInChildren...

    Cheers,
    Pärtel
     
  43. aaronUnity13

    aaronUnity13

    Joined:
    Nov 5, 2017
    Posts:
    4
    Partel, Thank you so much for Final IK. It's an incredible asset. But is there any way to watch the tutorial videos without the music? Maybe I'm the only one, but the music is quite distracting and makes the videos unwatchable for me. I can see the benefit of music for promotional videos, but not for instructional videos.
     
  44. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,556
    Hey,
    Yes, you can turn the volume down in YouTube :). But yes, I'm sorry, the ones with the music are the older ones, newer ones I made with voice over as already requested by other users.

    Cheers,
    Pärtel
     
  45. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    Hello, Im using VR-IK with UMA dynamic Avatar,

    I have this situation where the ARMS are following the VIVE controller, but the HANDS are 90 degrees in the wrong direction.

    So it looks like this

    ^
    | hands and fingers facing this way
    |
    <Controller =====arm======= BODY


    Code (CSharp):
    1.  
    2. VRIK vrik = gameObject.AddComponent<VRIK>(); // Adding the component
    3. vrik.AutoDetectReferences();
    4. vrik.solver.leftArm.shoulderRotationMode = IKSolverVR.Arm.ShoulderRotationMode.FromTo;
    5. vrik.solver.rightArm.shoulderRotationMode = IKSolverVR.Arm.ShoulderRotationMode.FromTo;
    Can anybody help?

    Thanks
     
    Last edited: Nov 24, 2018
  46. wojwen

    wojwen

    Joined:
    Feb 13, 2018
    Posts:
    38
    Hi! I’ve read on the PuppetMaster page that “PuppetMaster is fully compatible with Unity's built-in IK tools, as well as Final-IK.”. Does this mean that it works differently when Final IK is in the project as well? What are the differences?
     
  47. dred

    dred

    Joined:
    Apr 8, 2013
    Posts:
    30
    Hi Partel,

    I try to create some procedural animations with help of your tool, and for now I want ask you for help for me to begin. Maybe you already have some simple walk animation created programmaticaly with your tool and you can share it? best if it use Ragdoll and physics.

    Thnaks.
     
  48. iklw1115

    iklw1115

    Joined:
    Nov 14, 2018
    Posts:
    15
    Because I did not know how to attach a movie, I sent a email to support @ root-motion.com.
    If you have not received it please tell me.
     
  49. planetmarijn

    planetmarijn

    Joined:
    Mar 27, 2018
    Posts:
    2
    Is it possible to have something like extension limits? Right now I can only find examples of rotation limits. But I'd like to create a mechanical rig that has parts that can extend by sliding along one axis. And it would need to have limits on how far each part can extend. The particular object I'm thinking of is a crane used in film production. Like this one: http://mtjibs.com/equipment/technocrane/

    It looks like this is not included in Final IK, but is it possible to extend Final IK with this functionality? And would it be hard to do?
     
  50. Jonas-Neuston

    Jonas-Neuston

    Joined:
    Jun 10, 2017
    Posts:
    70
    Hi Partel,

    Love FinalIK. Thanks!

    My goal is to have Look IK with two separate look targets, one for the head and one for the eyes.
    Can FinalIK achieve this already? In the meantime I'm going to modify the code to do what I want.

    All the best,
    Jonas