Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

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

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

  1. Shinkaze33

    Shinkaze33

    Joined:
    Apr 1, 2019
    Posts:
    3
    Hey @Partel-Lang,

    Hope you don't mind that I cross-posted this to a support ticket on Root-motion.com first before finding this thread.

    I have a compound Character (Biped "wearing" an Exoskeleton rig) I am trying to make into a VR Avatar that is set up using the Unity Animation Rigging Package. Basically its an Exoskeleton that the biped is wearing, that should track along with the movements. (The Exo has a bone connecting at the hip and constraints at the hips, knees and balls of the feet).

    When I add VRIK to the character, the Animation Rigging constraints get "muted" and the exoskeleton no longer follows the character.


    I'm really noob at rigging so please let me know if this is even the appropriate way to accomplish this or if there is some incompatability with the new Unity rigging System I should be aware of,

    Thank you and Thank you for making such a great asset, we've enjoyed using it!
     
  2. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,340
    Hey, sorry for the wait!
    I have no idea actually, haven't seen that before. But looking at your targets hierarchy, I don't see the hands there, are the hand targets parented to the index controllers like they should be or are they in the mixamorigHips(1) hierarchy?

    Hey,
    Thank you for the purchase and for stopping by to say some kind words, much appreciated! :)

    Hey,
    Replied to your support ticket..

    Cheers!
    Pärtel
     
  3. Dmeowmixer

    Dmeowmixer

    Joined:
    Jan 25, 2015
    Posts:
    10
    No problem, thank you for the response. I apologize, I should have included that in the original post.

    The controllers are here in the original CameraRig that gets created when we initialize the SteamVR project.

    The Targets are in a separate object seen below. Did I set this up incorrectly?

    upload_2021-9-23_16-18-44.png
     
  4. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,340
    Hey,
    Looks correct, but not sure how I can help debugging it from here. Can you pause the scene after calibration, then click on each IK target's position? If they are where they are supposed to be, but the pose looks wrong (doesn't match the targets), then it's a problem with the solver or the calibration. If they are at the wrong positions, then it's something with the tracking and SteamVR stuff.

    Best,
    Pärtel
     
  5. VR_Junkie

    VR_Junkie

    Joined:
    Nov 26, 2016
    Posts:
    48
    Hello, I am using VRIK. My physical body is following my XR Rig (head and both arms) and copying its movements. I have locomotion weight set to 0 and am able to animate the legs this way (so when I move with thumbstick the legs play the correct animation). I tried to play a crouching animation and realized it doesn't work because the XR Rig head and arms don't decrease in height with the animation (which is the expected functionality).

    Here is my question/thoughts. When I play a crouch animation the legs bend to crouch but the upper body doesn't go down because they are trying to follow the XR Rig. Is there any way for the XR Rig to realize the legs are bent and lower itself to match the animation? I realize I could hardcode a standing and crouching height but was wondering if there was something built in that could accomplish it.
     
  6. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,340
    Hey,
    You can lower the head, but since it's supposed to follow the HMD, in first person you'd get an out of body experience, seeing your own head from above.
    If it's an avatar of another player (in a networked situation), then it is sometimes good to inherit some vertical motion from the animation, for example with animated locomotion, having some head bob carry on from the animation looks much more realistic than having the head perfectly locked to the HMD.

    Add a new empty child gameobject to what you currently use as head IK target, assign that new object to VRIK as head target instead. Then use this bit of code:

    Code (CSharp):
    1. void LateUpdate() {
    2.     Vector3 HMDPos = ik.solver.spine.headTarget.parent.position;
    3.     Vector3 animatedHeadPos = ik.references.head.position;
    4.     ik.solver.spine.headTarget.position = new Vector3(HMDPos.x, animatedHeadPos.y, HMDPos.z);
    5. }
    That will make the head target follow the HMD horizontally (so you can still lean), but animation vertically.

    Best,
    Pärtel
     
    VR_Junkie likes this.
  7. razzraziel

    razzraziel

    Joined:
    Sep 13, 2018
    Posts:
    275
    Hey all, I released an interaction handler tool for IK (Actually for Final IK). In the editor, it takes just two clicks to create new interactions. In runtime, it has similar rules for the interactions but for IK body parts instead of objects.

    It is better to watch so here is the trailer for it:
     
    Partel-Lang likes this.
  8. VR_Junkie

    VR_Junkie

    Joined:
    Nov 26, 2016
    Posts:
    48
    Hello, I am having an issue where my vrik body lags behind me when I move using the thumbstick. The root character gameobject has a rigidbody and two child gameobjects, the XR Rig and the vrik body. I use rigidbody.MovePosition to move my root character. Not exactly sure why the vrik body is falling behind (example video below)


     
  9. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,340
    Hey,
    Can you parent little cube objects to the hand controllers to see if they lag too? If they do, then it is something other than VRIK causing the issue. VRIK always reaches it's targets (provided they are in reach) 100% within a single update step.
    Do you have any physics set up for the hands?

    Best,
    Pärtel
     
  10. takuyacebok

    takuyacebok

    Joined:
    Jun 12, 2021
    Posts:
    4
    Hi again, I'm trying to synchronize multiple humanoid characters with a single VRIK. All of these characters have identical bone hierarchies, the only difference are their renderers. I've tried making empty gameobjects with transform and rotation constraints set to the actual trackers, and they work as intended, but there are always slight differences between each of them because of factors such as locomotion timing between steps and position. Thanks as always.
     
  11. VR_Junkie

    VR_Junkie

    Joined:
    Nov 26, 2016
    Posts:
    48
    So you're guess was correct. The hand objects use physics to move and I am using physics to move the character object. The hand objects are children of the character object and lag behind due to a physics issue. Do you have any advice on how to fix this? I know this isn't a vrik issue just asking in case its come up before.
     
  12. MidnightCoffeeInc

    MidnightCoffeeInc

    Joined:
    Feb 28, 2017
    Posts:
    298
    Hey, @Partel-Lang , first time posting on this thread, but I've had FinalIK for a while now.
    I am trying to use VRIK to allow users to pose characters on the 2D desktop mode, AND embody them in VR.
    To do this, I am switching the solver targets between the VR controllers and movable 3D objects in the scene.

    The problem is, when I scale the character up or down, the IK gets all messed up and the character gets stretched in all directions. These 3D objects are parented to the character so they all move together.
    Any ideas about how I would fix this?

    This problem doesn't occur when using the FullBodyBipedIK script in the same way. I'm just using VRIK so I can easily switch between the two targets.
    I hope this makes sense! Any help would be greatly appreciated!
     
  13. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,340
    Hey,
    If they're all Humanoid, then I'd use HumanPoseHandler for that:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using RootMotion.FinalIK;
    5.  
    6. public class PoseHandler : MonoBehaviour {
    7.  
    8.     public VRIK ik;
    9.     [Tooltip("Copy Pose From")] public Animator copy;
    10.     [Tooltip("Paste Pose To")] public Animator paste;
    11.  
    12.     private HumanPose pose = new HumanPose();
    13.     private HumanPoseHandler copyHandler;
    14.     private HumanPoseHandler pasteHandler;
    15.  
    16.     private void Start()
    17.     {
    18.         // Construct handlers
    19.         copyHandler = new HumanPoseHandler(copy.avatar, copy.transform);
    20.         pasteHandler = new HumanPoseHandler(paste.avatar, paste.transform);
    21.  
    22.         // Register to get a call from VRIK after every time it updates
    23.         ik.solver.OnPostUpdate += AfterVRIKUpdate;
    24.     }
    25.  
    26.     // Called by VRIK
    27.     void AfterVRIKUpdate()
    28.     {
    29.         // Copy
    30.         copyHandler.GetHumanPose(ref pose);
    31.  
    32.         // Paste
    33.         pasteHandler.SetHumanPose(ref pose);
    34.     }
    35. }
    36.  
    Hey,
    So don't use MovePosition to move your character controller, instead calculate the desired velocity and use AddForce() with ForceMode.VelocityChange to apply it to the Rigidbody. Something like this (in FixedUpdate):

    Code (CSharp):
    1. Vector3 targetVelocity = GetInputVelocity(); // GetInputVelocity should return the desired velocity vector based on thumbstick input.
    2. targetVelocity.y = rigidbody.velocity.y; // Use that to maintain gravity
    3. Vector3 acceleration = targetVelocity - rigidbody.velocity;
    4. rigidbody.AddForce(acceleration, ForceMode.VelocityChange);
    Then, all you need to do is apply the exact same acceleration to the hands:

    Code (CSharp):
    1. leftHandR.AddForce(acceleration, ForceMode.VelocityChange);
    2. rightHandR.AddForce(acceleration, ForceMode.VelocityChange);
    Hey,
    VRIK has the "Scale" parameter (under "Solver") for precisely that purpose. Use scale 1 for normal human-sized characters. If you scale them down by half, set Scale to 0.5.

    Cheers,
    Pärtel
     
    takuyacebok likes this.
  14. MidnightCoffeeInc

    MidnightCoffeeInc

    Joined:
    Feb 28, 2017
    Posts:
    298
    Thanks for the reply!
    What is "normal human size" though? Just their starting scale? Different characters have different starting scales that I have to manually adjust to being the correct height for my app. But you're saying I just adjust that value up or down depending on the change in percentage from 100%?
    Thanks!
     
    Last edited: Oct 8, 2021
  15. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,340
    It's unitless, so normal human size is the size you originally tweaked all the parameters for. So consider that a 100%. If you want a 50% smaller character to behave the same way as that original one, set its scale to 0.5.

    Best,
    Pärtel
     
    MidnightCoffeeInc likes this.
  16. MidnightCoffeeInc

    MidnightCoffeeInc

    Joined:
    Feb 28, 2017
    Posts:
    298
    Got it, thanks!
    I also noticed that FBIK Does a pretty good job of detecting the correct humanoid bones, even if the rigged model doesn't have a humanoid avatar set up. Is this something that could also be done with VRIK?
    I am importing characters at runtime using Trilib 2, but sometimes it doesn't detect the humanoid avatar, despite it being one.
     
  17. TPEUnity

    TPEUnity

    Joined:
    Jan 17, 2018
    Posts:
    34
    Hi. I have setup that is pretty much like mentioned here :


    My problem is when using Grounder Full Body Biped paired with that and when the pelvis gets lowered the aim position seems to remain in the non-lowered position resulting in awkward aiming position. Is there anything I can do to counter this?
     
  18. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,340
    Hey,
    I always thought FBBIK doesn't do a really good job at finding the bones, which is why I didn't add it to VRIK. VRIK uses a different set of references, but if you import this little patch, you can have FBBIK references autodetect them and copy them over to VRIK refs like so>

    Code (CSharp):
    1. public VRIK ik;
    2.  
    3.     private void Awake()
    4.     {
    5.         BipedReferences bR = new BipedReferences();
    6.         BipedReferences.AutoDetectReferences(ref bR, transform, BipedReferences.AutoDetectParams.Default);
    7.  
    8.         ik.references = new VRIK.References(bR);
    9.         ik.GuessHandOrientations();
    10.     }
    Hey,
    The problem is with the update order of things. You'll need FBBIK solved first (for grounding), then AimIK and then another IK pass to put the left arm back on the gun (only if you have included arm bones in AimIK). It would be a waste to use a FBBIK pass only for the left arm, so better to do that with LimbIK.
    Here, grab this package, I made an example scene for you (also updated SecondHandOnGun.cs to support grounder).

    But see if you can use only the spine bones in AimIK. If so, you can just remove LimbIK and SecondHandOnGun and keep things nice and simple.

    Best,
    Pärtel
     
    TPEUnity and MidnightCoffeeInc like this.
  19. contempt

    contempt

    Joined:
    Jul 31, 2012
    Posts:
    88
    Partel-
    As always your asset and help has been invaluable while developing our sports game. I have a question, we are using LookAtIK to have the defensive player look at their assigned player to cover and we want the offensive player to look in the direction of their turn. Is there a good way to achieve this without turning the offensive player's body and throwing off our custom character animator controller that uses player orientation to determine a normalized direction?
     
  20. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,340
    Hey,
    You could set the offsensive player's LookAtIK target like this:

    Code (CSharp):
    1. float lookDistance = 10f;
    2. float lookHeight = 1.5f;
    3.  
    4. ik.solver.IKPosition = ik.transform.position + Quaternion.AngleAxis(turnAngle, Vector3.up) * ik.transform.forward * lookDistance + Vector3.up * lookHeight;
    5.  
    But a more efficient way of doing pretty much the same thing would be to just add some world space rotation offset to some of the spine bones:
    Code (CSharp):
    1.  
    2. public Transform[] spine;
    3.  
    4. void LateUpdate() {
    5.     float boneAngle = turnAngle / spine.Length;
    6.     foreach (Transform spineBone in spine) {
    7.         spineBone.rotation = Quaternion.AngleAxis(boneAngle, Vector3.up) * spineBone.rotation;
    8. }
    9. }
    Best,
    Pärtel
     
  21. VR_Junkie

    VR_Junkie

    Joined:
    Nov 26, 2016
    Posts:
    48
    This is very specific to my game and honestly bad setup on my part so no problem if this isn't doable. I was wondering if I could move the gameobject with VRIK attached through thumbstick?

    My setup is my xrRig and my characterPrefab (characterPrefab with vrik) are two different gameobjects. The characterPrefab has a rigidbody and capsule collider as well reference to the xrRig head and hands in the vrik. I was previously moving the characterPrefab through thumbstick but since attaching vrik realize that vrik overrides my thumbstick movement. Is there a way for my thumbstick to continue to effect the movement of the characterPrefab (through rigidbody movement)?
     
    Last edited: Oct 20, 2021
  22. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,340
    Hey,
    Please update Final IK, just released a new version a couple of days ago. Take a look at the "VRIK (Animated Locomotion)" demo. In that demo you can move around with WASD. It's not a rigidbody, but it might as well be one. Basically you'd need the same kind of setup - VRController in that demo should be your xrRig with the thumbstick input and head and hand targets parented to it and the avatar next to it (can also be parented to the VRController).

    Best,
    Pärtel
     
  23. Rispat-Momit

    Rispat-Momit

    Joined:
    Feb 14, 2013
    Posts:
    253
    Hi Partel and thank you for the incredible IK System!!!

    I am setting up some custom codes to implement the system in my game and I am stuck on this issue:

    This code works fine :
    Code (CSharp):
    1.             ArmIKComponent.solver.arm.shoulderRotationWeight = 0;
    2.  
    but this doesn't:
    Code (CSharp):
    1.            ArmIKComponent.solver.arm.positionWeight = 0;
    2.  
    Does anyone know how I can make this work? I am trying to affect the "ArmIK"

    Thank you!

    Rispat
     
  24. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,340
    Hey,
    It's a bit confusing, because ArmIK's solver is actually just VRIK's arm solver so IKSolverArm is basically like a wrapper for IKSolverVRArm.

    Use armIKComponent.solver.positionWeight/rotationWeight, that overrides solver.arm position and rotation weights.

    Best,
    Pärtel
     
    Rispat-Momit likes this.
  25. homemacai

    homemacai

    Joined:
    Jul 22, 2020
    Posts:
    43
    Hello there, so after updating Final IK And Puppetmaster, I am getting a lot of ambiguous code errors between Puppetmaster and Final IK. Anything I should have done before updating?
    All of the errors derive from this:
    Assets\Plugins\RootMotion\Shared Scripts\PropertyAttributes.cs(71,15): error CS0101: The namespace 'RootMotion' already contains a definition for 'LargeHeader'

    *SOLVED - Jus had to delete the Large Header and Lager Header Drawer.cs files. But a bit weird i think
     
    Last edited: Oct 27, 2021
  26. VR_Junkie

    VR_Junkie

    Joined:
    Nov 26, 2016
    Posts:
    48
    Hello, I was hoping you could make the animator in VRIK.cs a public variable. My setup involves the gameobject with the animator attached being a different gameobject than the one with the VRIK attached. This used to work but now throws an error ("VRIK cannot find Animator on the VRIK root gameobject").
     
  27. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,340
    Hey,
    Yeah, always best to delete the old version before updating assets. Otherwise you'll keep the files that I've deleted.

    Hey,
    I see, I'll make these changes to IKSolverVR.cs:
    Animator.PNG

    Cheers,
    Pärtel
     
  28. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    831
    Hi. I still have my old extended VRIK driver in my car project and i want to reactivate.
    Is there a "fast" way to snap Unitys Gawain charakter to on it?
    Only searching for a quick adwise.
     
  29. Rispat-Momit

    Rispat-Momit

    Joined:
    Feb 14, 2013
    Posts:
    253
    Hi Partel :)

    Thank you for helping me with the coding. I am so excited to see my main character coming to life.

    I have a new question (issue). I am using a very basic code to make certain objects attached to the player. In order to get those objects to follow the player's motion and positioning, I set them to follow the transform of the player's bones. NOT as children but as unparented objects.

    The issue is that they won't follow the bones after the IK takes over. They look like they are remaining in the original position of the bones.

    Is there a way to fix that?

    Thank you!
     
  30. RobotFlow

    RobotFlow

    Joined:
    Aug 11, 2020
    Posts:
    17
    Hi,

    I have bought your great plugin, but I can make the interaction system work.

    My OS is win10, Unity version is 2020.3.

    My procedures:
    1. I add Dummy Ragdoll (Configurable Joints), a plane (as ground), a sphere (to be interacted with) to the scene.
    2. Add Full body biped IK to Dummy, changes nothing, it works perfectly.
    3. Add Interaction System to Dummy, changes nothing
    4. Pose sphere to a proper position and adjust its size.
    5. Add Interaction Object to the sphere, add 1 weight curve. Nothing else changes
    6. Add sphere to Interaction System Test GUI, which is attached to Dummy.
    7. Add effector in Interaction System Test GUI

    In play mode, the button "Start Interaction With Sphere" shows, but the Dummy does not move at all.

    Pretty much the standard procedures if I understand correctly. But it just not work.

    Can you help me with this? maybe I miss something?

    Besides, the Character interaction demo (FINAL IK - Character to character interaction with FBIK - YouTube) is really cool, is there a tutorial for this? Thanks!
     
  31. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,340
    Hey,
    That Gewain probably has different bone orientations than the old character, so I don't think there is a very easy quick way to switch, sorry.

    Hey,
    The problem is with the update order of things. The script that does the "parenting" just updates before Final IK runs. If you can set that script to a higher value than Final IK components have in the Script Execution Order, then it will work.

    Hey,
    Looks like a bug sneaked into the latest version that does not start the interaction when there is no InteractionTarget parented to the object. Please grab this patch to fix it. But you'll probably need to add an InteractionTarget anyway, to match the fingers to the object.

    About character+character, don't have a tutorial for that specifically, but basically the idea is that you create a single interaction object, then add 2 InteractionTargets to it: one for character A's hand and the other for character B's hand. Then start interaction on both characters at the same time.
    About posing the hands, create a duplicate of both characters, move and pose the hands of those duplicates to meet as in a handshake. Parent the hands to the interaction object and nuke the rest of the duplicated models. Add InteractionTarget to both hands.

    Best,
    Pärtel

    Best,
    Pärtel
     
    Rispat-Momit likes this.
  32. RobotFlow

    RobotFlow

    Joined:
    Aug 11, 2020
    Posts:
    17
    Thanks for your help, the patch did solve the problem!
     
    Last edited: Nov 1, 2021
  33. RobotFlow

    RobotFlow

    Joined:
    Aug 11, 2020
    Posts:
    17
    Hi, I thought I get the character + character thing done, but I find my way seems incomplete.

    My procedures:
    1. load 2 ragdolls, and create a sphere.
    2. Adjust the hand pose in the play mode and copy both (one is left, one is right), deactivate the play mode, and paste
    3. Move the pasted hand under sphere. Sphere is an interaction object, 1 position curve is set.
    4. The pasted hands are added with interaction target. I changes the effector type to "left hand" and "right hand" correspondingly, the rest remains.
    5. For the two ragdolls, I add hand poser to the hand part. In hand poser, I set "Pose root" to the pasted counterpart under the sphere.
    6. For the two ragdolls, in the root level, I set interaction system and full body biped IK. And I add a C# script like HoldCube in this video (FINAL IK TUTORIAL - Full Body Biped IK - Linking Effectors to Objects - YouTube).

    Comments:
    1. if I do not use C# script in step 6, when I hit the play button, nothing will happen.
    2. if I add Interaction System Test GUI to both ragdolls and not the C# script, only one (the last one) will take effect.
    3. The left hand and right hand are not very well interwined, I just place them in the region of the sphere, will this be a potential problem?

    Results:
    1. When play, if I move the sphere, then two body will move accordingly
    2. However, if I move other joint of ragdoll A in Full Body Biped IK, ragdoll B will not move accordingly (the chain seems broken at the sphere).
    3. The sphere is fixed, so if I make the ragdoll walk, the sphere will not follow.

    My question is how to make Result 2 and 3 mentioned above work as desired (like in the demo video)?

    Thanks in advance!
     
    Last edited: Nov 1, 2021
  34. swantonb

    swantonb

    Joined:
    Apr 10, 2018
    Posts:
    78
    Hello there,

    I'm considering using this asset for my project but before i do so i have a question: has there been implemented any sort of multi threaded code for it? I have a friend who used this asset for his game, using full body and even with 10 players he would get considerable cpu time in the update and late update. Around 0.5 ms for update and 0.7 ms late update for just 10 players. That is pretty much unacceptable for me. Has anything changed in the meantime? This happened a long time ago and my friend dropped this asset for the big cpu time it caused, even tho the looks were amazing.. he went for a FP hands approach but i dont quite like that. I want to do a real full body experience and i see this asset is getting updates, maybe the performance of many instances changed?

    Thanks for your help.
     
  35. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,340
    Hey, sorry, looks like I missed a notification here.
    Would you mind sending me that scene where you set it up as a unitypackage so I could have a closer look at what's going on there?

    Hey,
    Animation and especially IK are terrible candidates for multi-threading by nature because they need to work on hierarchical data structures and be solved in specific linear order. I have made multiple test cases (AimIKJ and CCDIKJ solvers based on Animation Jobs, also the same using Animation Rigging framework), but they are all much slower than their old single-threaded counterparts, even if used on 100 or more characters. DOTS animation is going to be faster, but most likely not nearly as much as you've seen in some of the DOTS tech demos that are about moving tens of thousands of independent objects.

    Anyway, in many cases I'm seeing FullBodyBipedIK overused, meaning the same things could be done with just simple LimbIK/ArmIK, that would be multiple times faster and more efficient.

    Best,
    Pärtel
     
  36. RobotFlow

    RobotFlow

    Joined:
    Aug 11, 2020
    Posts:
    17
    Hi, I sent an email to support@root-motion.com, the title is "Setup Character Interaction with Final IK "

    Thanks!
     
  37. Roamer79

    Roamer79

    Joined:
    Oct 25, 2016
    Posts:
    44
    Just wondering if there is a simple T-Pose calibration available to resolve full body tracker orientation? For some workflow uses this really is essential.
     
  38. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    258
    Hello
    I am trying to animate FBBIK's weight value using an animator controller and I saw your solution:
    Code (CSharp):
    1. public AimIK ik;
    2. [Range(0f, 1f)] public float weight;
    3. void Update() {
    4. ik.solver.IKPositionWeight = weight;
    5. }
    Is there an alternate way of doing this? I would like to avoid having to add an Update method just for this.
    I have tried doing it on a setter property but since Animator COntroller can only animated Serialized properties and they cannot have setters I cannot do it like this.

    I hope you have some ideas.

    Thanks
     
  39. VR_Junkie

    VR_Junkie

    Joined:
    Nov 26, 2016
    Posts:
    48
    Hello, I'm using VRIK and had a question regarding your relatively new Locomotion mode "Animated". If I'm understanding correctly that basically makes it so animations control the lower half of your body based on your movement in real life (kind of like how some character controllers control animations through their velocity). Is there any way for me to use this system to add a custom animation where the lower body changes based on a button press (for a kick animation).

    Edit: I made a ticket for this question as well as I wasnt sure which one was appropriate
     
    Last edited: Nov 12, 2021
  40. PhilFaily

    PhilFaily

    Joined:
    Jul 31, 2017
    Posts:
    12
    Hi Partel,

    I've noticed an interesting issue with the LookIK, see images. :)

    This issue happens after these characters have died and then are recycled by having their state reset.

    I was wondering if it has anything to do with the initial orientation of the eye transforms when the components are re-enabled? Does the eye IK rely on the initial pose on enable?
    wonkyEye01.png wonkyEye02.png
     
  41. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,340
    Hey,
    All I have is what you see in the "VRIK (Calibration)" demo, using VRIKCalibrator. But it already requires for you to know how trackers are worn. If you wanna ask the player to stand in T-Pose, you could calculate those axes using the methods available in RootMotion.AxisTools.

    It's one of Unity's best kept secrets (undocumented), but there's a MonoBehaviour.OnDidApplyAnimationProperties().
    You can use it like this>
    Code (CSharp):
    1. public AimIK aimIK;
    2.     public float weight;
    3.  
    4.     public void OnDidApplyAnimationProperties()
    5.     {
    6.         aimIK.solver.IKPositionWeight = weight;
    7.     }

    Hey,
    Yeah, if you wanna kick, just make the animator transition to the kick state and return back to the VRIK locomotion state after it's done.

    Hey,
    LookAtIK samples the eyes to find the forwards only once and that is when the solver is initialized in Start, so it shouldn't do that really. Try calling this after you respawn>

    Code (CSharp):
    1. foreach (IKSolverLookAt.LookAtBone eyeBone in ik.solver.eyes)
    2.         {
    3.             eyeBone.axis = eyeForwardAxis;
    4.         }
    Does that fix it?
     
    Hazneliel likes this.
  42. Roamer79

    Roamer79

    Joined:
    Oct 25, 2016
    Posts:
    44
    Thanks but I just looked into this and your documentation is incomplete. The 'more' links are dead and the tool functionality description is ambiguous.
     
  43. JhonRA77

    JhonRA77

    Joined:
    Sep 9, 2021
    Posts:
    51
    I tried to use it on my character and it's not working fine.
    I'm using the Interaction Pick Up 2-Handed scene.

    The Pick Up Box script I'm using it with my character the one in the middle.
    I duplicated the Box object the Pivot and the Hold Point and put them in my character rig hierarchy.

    The screenshots :

    1. The pick up box inspector settings



    2. My character inspector settings. My character have also animator. and his own animator controller.







    3. The hold point



    4. The Box (1)




    You can see In the screenshots the character hands and the body.

    I did automatic detect for the references.

    If I play with the hold point position while the game is running then at some points it looks fine but then it's pushing the character very fast backward nonstop.
     
  44. fullerfusion

    fullerfusion

    Joined:
    Dec 2, 2018
    Posts:
    13
    Hi Partel,
    I need some help regarding the LookAt IK. I'm having this weird issue with my character's head titling downward when the target object is behind character and while it's running.

    In the first video, I made a DoTween Path with 4 waypoints to have the sphere move 360° around the character. The LookAt works fine when the sphere moves in front of the character and it's not running

    ,

    However, in the second video, I made the character run and when the sphere moves behind the character, the head does this weird titling downward. Is there a way I can fix this?

    I have attached a screenshot of my LookAt component in the Inspector.
     

    Attached Files:

  45. wtetotew

    wtetotew

    Joined:
    Apr 12, 2020
    Posts:
    55
    Hi!

    how can I make my character to look at the interaction object when i start the interaction with this object.
    Basically, I want to change the look at target when interacting.

    thanks a lot!
     
    Last edited: Nov 16, 2021
  46. Musonica

    Musonica

    Joined:
    Jul 25, 2017
    Posts:
    8
    Hi Partel, A quick question about something that has caused me many hours of searching and frustration...

    I have an object that has a number of right hand interaction targets. I need to blend the right hand smoothly between the targets with an interaction trigger.

    After trying a lot of things, at the moment it either moves back towards the natural animation pose in the middle of the blend, or is offset in strange ways...

    Is there a simple way to do this correctly?

    Many thanks!
     
  47. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,340
    Hey,
    That kid from space just has really tiny hands, like T-rex. So in order for it to reach the object it needs to lean in a lot.
    Would help to set "Maintain Head Rot" to 1 so the giant head wouldn't get in the way as much. Should also move the hold point closer in editor mode.

    Hey,
    Replace LookAtIK with AimIK. Use the head as the Aim Transform.
    AimIK has Pole Target, that you can add above the character and use it to constraint the up axis of the head to that.
    AimIK also supports RotationLimits of you wanna use those.

    InteractionSystem has support for LookAt already built in. Add a LookAtIK component, assign it to the InteractionSystem (expand "Look At" on the bottom of it).

    Hey,
    Should use a single InteractionTarget, then use Animation to modify that. Add an Animator to the InteractionTarget, open the Animation Window, click on "Create" and you're ready to animate.

    Hey, sorry about that. The "documentation" for that is currently just in the tooltips of the variables. But basically what you need to do is just assign the controllers and trackers to the VRIK Calibration Controller, set their forward and up axes above (read their tooltips to know which is which) and call for Calibrate. Make a duplicate of VRIKCalibrationController so you could replace that if (Input.GetKeyDown(KeyCode.C)) with whatever input you want to use for triggering the calibration.

    Best,
    Pärtel
     
  48. wtetotew

    wtetotew

    Joined:
    Apr 12, 2020
    Posts:
    55
    Got it thanks. How do you modify lerp and weight speed independently for "resume interaction" after a pause though?
    Also, how do i do if I have multiple targets? (change the look at target on runtime)
     
  49. Aborup

    Aborup

    Joined:
    Oct 17, 2012
    Posts:
    5
    There's a `speed` property on InteractionSystem to control the master speed of all interactions, but can I control the speed of a single InteractionObject?
     
  50. coolgaspumper

    coolgaspumper

    Joined:
    Jun 30, 2015
    Posts:
    1
    Hey @Partel-Lang,

    I'm working on trying to get the calibrator working with my character but running into a problem where after I run the calibrator, my feet are planted to the floor. The plant feet bool in the VRIK script is never being set to true. Here's a video where you can kind of see how the feet are shuffling around like normal before I scale the model, then when I select the blue button and run the calibrator, the feet are rooted to the floor. Any idea what could be causing this? Thanks.

     
unityunity