Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. 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. Fragment1

    Fragment1

    Joined:
    Aug 30, 2013
    Posts:
    67
    Hello, I've been fiddling with this for ages and can't quite figure it out so hoping someone here might have an idea.

    Working on a fairly involved 3d-space climbing system using FBBIK, I need to manually calculate the angle of a hand grabbing a pole. The pole could be any position or angle around the character in question. They can grab any part of the pole, not just a defined "grab center".

    Basically, what I need is to have an additional bone in the FBBIK chain for the hand's grab point, that uses the that point as the final node, making sure the wrist complies with that.

    I need to know before running fbbik what angle the hand is going to be approaching from, so that I can set my offset dependant on that angle.

    It's a bit like the steering wheel example where the wrist is offset from the target point. Except instead of coming in from a well defined seating position, they could be reaching from any direction - and any distance meaning bent elbows.

    Thanks :)
     
    Last edited: Jun 16, 2022
  2. erw29

    erw29

    Joined:
    Sep 27, 2018
    Posts:
    13
    Hi Pärtel,

    is it somehow possible to perform "easy" arm length scaling on basis of LimbIK? ArmIK got this possibility but I'm using LimbIK.

    Best,

    Erik
     
  3. matorga

    matorga

    Joined:
    Nov 26, 2021
    Posts:
    5
    " That works if the skinning of the mesh supports that kind of thing. If you have all the forearm vertices skinned only to elbow and all hand vertices to hand bone and there's no smooth blending between the two, it will not look good."

    I don't know if I understand what you are saying. Do you have any example that I can see to try to mimic the skinning. Thanks
     
  4. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    Should not assign golf head as hand bone. Instead, make a duplicate of the hand bone with the club attached to it. Assign that duplicated hand as the hand IK target. Make a new gameobject where the club head is at and parent the duplicated hand to that.

    Hey,

    Final IK components sample the pose at Start to find out which way to bend the limbs. Mixamo rigs are usually in perfect T pose so it can't calculate that. Just rotate the knee and elbow bones a little bit in their natural bending directions in Editor.

    Hey,
    Basically you'd want to just rotate the IK target around the center of the pole. The Interaction System already has that built in with the Interaction Targets. Like in the "Interaction" demo you can move the Dummy to the other side of the button and it will still be able to push it. That is because the interaction targets are rotated around the vertical axis to align with the rotation of the hand as it is in the animation.

    Hey,
    There are 2 ways you can stretch an arm:

    1. Just change localScale of the upper arm bone.
    2. Multiply the localPosition of the forearm and hand bones.

    If you don't have any animation overriding those channels every frame, you can do it just once in Start. If there's animation that is reverting those changes, will have to be applied in every LateUpdate.

    Hey,
    A good example is the Dummy character. If you look at the "VRIK (Basic)" demo and change arm length mlp, you'll see the arm breaking up. That is because it is skinned like a skeleton or a robot, not like a human being with some flesh on the bones. There is no smooth blending of bone weights from bone A to bone B. All vertices belong to either bone A or bone B. That is the difference.
    Did you try just scaling the upper arm bone?

    Best,
    Pärtel
     
  5. hodge47

    hodge47

    Joined:
    Apr 14, 2014
    Posts:
    25
    Thanks for your response.

    I threw a random character into Mixamo and bent the arms and legs in the unity editor, but the same thing is still occurring. I over-exaggerated the leg bend in this video, but the same applies to a minor bend.


    Link just in case the forum doesn't like the gif (it's broken in the preview but not post editor): https://gyazo.com/6c6cd94a45161c06fdf60d5bc74a070e

    Thank you again for your time.
     
  6. GoldFireStudios

    GoldFireStudios

    Joined:
    Nov 21, 2018
    Posts:
    160
    Banging my head against the wall on this one, hoping someone has an idea as to what could be going on.

    I'm using a cinemachine virtual camera for a first-person view on a player character using FBBIK. This works great, except that when there is any frame drop, the camera falls behind the body. The vcam is set to follow the head bone, but I also tried updating the position of the vcam directly to match the head bone in `fullBodyIKSolver.OnPostUpdate`. Any ideas?

     
  7. Arjun-Gupte

    Arjun-Gupte

    Joined:
    May 31, 2013
    Posts:
    54
    It seems to be working in Unity version 2021.3.4f running on apple silicon.
    Thanks for your help.
     
    Partel-Lang likes this.
  8. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Oh, I see....Need to adjust the rotation of the IK targets if the bone orientations are different. Final IK components work by matching rotations of bones to the target's rotation. Unity IK uses some universal rotations because it can do so as it only works with Humanoids, but FIK works with Generic too. I'd add a new child gameobject to the IK target, assign that as the IK target instead. Then you can adjust the localRotation of the child object to fix that rotation issue.

    Hey,
    I have not tried Cinemachine myself, but I'm guessing it just updates before FBBIK. Even if you move its target in OnPostUpdate, if Cinemachine updates before that, it won't help. Need to either make Cinemachine update after FBBIK if that's possible (usually not with Unity stuff) or make FBBIK update before Cinemachine. Can do so by disabling the IK component and calling ik.solver.Update(). Might have to disable the Animator too and call Animator.Update(); and then ik.solver.Update() from Update.

    Best,
    Pärtel
     
  9. matorga

    matorga

    Joined:
    Nov 26, 2021
    Posts:
    5
    Yes but then the hands deform when they rotate. I also want to be able to adjust the arms length during play mode and scaling brings me more inconveniences
     
  10. GoldFireStudios

    GoldFireStudios

    Joined:
    Nov 21, 2018
    Posts:
    160
    Thanks, this turned out to be the issue! And, to my surprise, Unity did indeed add a manual update option to cinemachine. There is a CinemachineBrain.ManualUpdate() method you can call if you change the update method on the brain to "manual." Doing this got everything updating nice and smooth.
     
    Partel-Lang likes this.
  11. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    They shouldn't deform if you scale them uniformly. But if you can't do scaling, then fixing the skinning to look good when localPosition of the hand is changed is the only way to go.

    Best,
    Pärtel
     
  12. h8476532

    h8476532

    Joined:
    Mar 14, 2022
    Posts:
    17
    Excuse me, sir! I have some questions.
    I using the CCD IK to the 6 joints robotic arm in the final ik package, when I drag the end effector to move the arm, the arm will pass through the base, I already set up the rigid body and the collider, how can I resolve it?
     
  13. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    There's no solver in FIK that can solve for both the position and rotation of the target. CCDIK and FABRIK can solve for the end position only. Can use RotationLimit components to constrain the joints, but there's no collision detection.

    If your robot happens to be a KUKA or an UR5, I have made custom solvers for them before.

    But if you are looking for collision detection, you can actually rig that robot like a ragdoll. This package is an example of how PhysX can be set up something like an inverse dynamics solver to solve any kind of robotic rig.

    Best,
    Pärtel
     
  14. doombob

    doombob

    Joined:
    Jan 25, 2014
    Posts:
    23
    Hey there, I've got a question. I'm using the ArmIK component in conjunction with a slightly modified version of
    IKExecutionOrder to allow me to combine a timeline containing animation tracks with a custom ArmIKWeightTrack of my own which uses FinalIK to apply IK after some pre-recorded mocap animation has been applied.

    I am currently using code to replace the fact I don't have an animation team, so being able to scrub back and forth in the timeline in edit mode is incredibly useful for aligning IK targets and making corrections to misaligned mocap animations.

    Anyway, long story short, I am doing the following in my track mixer to control the IK weights on the ArmIKs.

    Code (CSharp):
    1. [ExecuteAlways] // NOTE: To allow for scrubbing in edit mode
    2.     public class ArmIKWeightTrackMixer : PlayableBehaviour
    3.     {
    4.         public override void ProcessFrame(Playable playable, FrameData info, object playerData)
    5.         {
    6.             var armIK = playerData as ArmIK;
    7.             if (armIK == null)
    8.             {
    9.                 Debug.LogError($"{nameof(ArmIKWeightTrackMixer)}: {nameof(playerData)} is not {nameof(ArmIK)}");
    10.                 return;
    11.             }
    12.  
    13.             var timelineTime = playable.GetGraph().GetRootPlayable(0).GetTime();
    14.             var anyClipPlaying = false;
    15.             for (var i = 0; i < playable.GetInputCount(); i++)
    16.             {
    17.                 // Get the IK weight behaviour and process it
    18.                 var inputPlayable = (ScriptPlayable<ArmIKWeightBehaviour>)playable.GetInput(i);
    19.                 var behaviour = inputPlayable.GetBehaviour();
    20.                
    21.                 // Get the input weight for this input
    22.                 var inputWeight = playable.GetInputWeight(i);
    23.                
    24.                 // Get the solver for the effector
    25.                 var armIKSolver = armIK.solver;
    26.                
    27.                 // Get the starting and ending time for the behaviour
    28.                 var clipStart = behaviour.StartTime;
    29.                 var clipEnd = behaviour.EndTime;
    30.                
    31.                 // Only consider the clip if it is currently playing
    32.                 if (timelineTime >= clipStart && timelineTime <= clipEnd)
    33.                     anyClipPlaying = true;
    34.                 else
    35.                     continue;
    36.                
    37.                 // Ignore any inputs with 0 weight
    38.                 if (inputWeight == 0)
    39.                 {
    40.                     Debug.Log($"Input {i} has weight 0, ignoring");
    41.                     continue;
    42.                 }
    43.                
    44.                 var target = GameObject.Find(behaviour.TargetName).transform; // TODO: Cache this
    45.  
    46.                 if (target != null)
    47.                 {
    48.                     // Set the IK target
    49.                     armIKSolver.arm.target = target;
    50.                    
    51.                     // Set the IK position and rotation weights
    52.                     armIKSolver.IKPositionWeight = Mathf.Clamp(inputWeight, 0f, behaviour.MaxWeight);
    53.                     armIKSolver.IKRotationWeight = Mathf.Clamp(inputWeight, 0f, behaviour.MaxWeight);
    54.                 }
    55.                 else
    56.                     Debug.LogError($"{nameof(ArmIKWeightTrackMixer)}: {nameof(behaviour.TargetName)} is not found");
    57.             }
    58.            
    59.             // If no clips were playing, set the IK weights to 0
    60.             if (!anyClipPlaying)
    61.             {
    62.                 armIK.solver.IKPositionWeight = 0f;
    63.                 armIK.solver.IKRotationWeight = 0f;
    64.                 Debug.Log($"<color=yellow>No clips were playing, setting IK weights to 0</color>");
    65.             }
    66.         }
    When scrubbing and playing at runtime, this results in what looks like a slerping of the hand effector position. I expect this is what's going on deep down in the FinalIK code, but is there a way of calculating a direct position and rotation given a given weight along the timeline?

    IK_weight_slerping.gif

    I love FinalIK and use it in all my VR training applications, but this one has me stumped and my deadline is uhh.. yesterday :S

    Any help or suggestions would be greatly appreciated!

    Thank you!
     
  15. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    When running IK from editor there are a couple of things to keep in mind.
    When the solver is reinitialized (when you recompile scripts), it needs to init with the character in the same pose every time.
    Also, between every solver update the pose must be overwritten by either animation or calling ik.solver.FixTransforms(); otherwise the solver will solve additively on top of its own results frame by frame.
    In Final IK there is the EditorIK component that can be used to properly initialize and run IK components in editor.
    Add the component, create an EditorIKPose asset (scriptableobject) to store the default pose into and click on Start Solver to see how that works. Not sure if can be used together with Timeline the way you have that set up, but maybe the code in EditorIK can help you get it working.

    Best,
    Pärtel
     
  16. h8476532

    h8476532

    Joined:
    Mar 14, 2022
    Posts:
    17
    Thank you! My robotic arm is staubli, I will check the package that you gave me.
     
  17. cloverme

    cloverme

    Joined:
    Apr 6, 2018
    Posts:
    200
    Update: Whoops, nevermind, found the demo where it was setup as an example.

    I noticed that SecondHandOnGun.cs is included now in the FinalIK package but doesn't match the tutorial any longer for setting it up since it wants "LimbIK". How do you set up the new one?
     
  18. Giantbean

    Giantbean

    Joined:
    Dec 13, 2012
    Posts:
    144
    I have been reading a bunch of posts on this forum and may have missed an answerer to a similar set of questions but as I am having difficulty I figure its best to just ask. So...
    1). Using VRIK I am looking at the demos and trying to see how they work with VR however they also seem to just be WASD controls. I tried to set up an XR Origin similar to the Steam VR set up videos and this worked for my own character rig but not in the demos. I would like to make the demos work too for ease of learning. Any help setting up VR with Unity XR would be appreciated.
    2). The avatar seems to have trouble keeping its feet under itself. I plan to implement grounder once I understand how and I am using an 8 directional animated lower body but is there anything calculating the center of mass. Something like THIS? I wont necessarily use such a calculation as I will be using joystick or free motion in an Omni or KatVR treadmill but its an interesting thing to consider for VRIK and using Ragdoll on an IK as this dev does would be interesting for a Puppet master VR addon.
    3.) It seems the calibration is just scaling the avatar model which can make my avatar look very thin and frail as Its a 6 foot character being scaled to my 5'5" height. Is there a way to sort of stretchy IK shorten the bones without making the model slimmer? The calibration also seems to mess up the head and hand location. Is there a universal fix for this so any player can calibrate without making the avatar offset from the tracking?
    Thanks!
     
  19. Giantbean

    Giantbean

    Joined:
    Dec 13, 2012
    Posts:
    144
    Is there a fourth cause? The legs' seem to be stuck to one position and stretchy from that world position to the players position when the locomotion weight is set to zero.
    1)Leg position and rotation are not set to 1
    upload_2022-7-14_11-25-17.png
    2) The animator is not disabled
    3) The the apply root motion is checked and the legs are not moving anyway.
    upload_2022-7-14_11-29-2.png
    When the Locomotion weight is set to 1 the legs are under the body but jitter a lot and slide around a bit while standing still.

    Edit: Implementing grounder took me a while to figure out with my rig and I still have some issues. The feet no longer shuffle when they shouldn't however the character is in the ground now. I think I saw another post about this so I will try to find that solution.
     
    Last edited: Jul 14, 2022
  20. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    Please take a look at the "Second Hand On Gun" demo included in the package for reference.

    Hey,
    1. Here's the VRIK Animated Locomotion demo set up with Unity XR.
    2. I recommend you to use the new animated locomotion mode (set Mode to Animated in Locomotion settings), see the locomotion section in the user manual about how to set up the animator controller or use/extend the one included in the package).
    3. Can use Arm Length Mlp and Leg Length Mlp in VRIK arm/leg settings to stretch the limbs.

    If there's no locomotion, there will be nothing moving the root of the character so it stays where it's at until you move it by code or animation with root motion.
    About the Grounder, please see the "VRIK (Grounder)" demo. VRIK leg solver can't be used by Grounder for technical reasons, so will have to use GrounderIK and 2 LimbIK components for the legs, make sure the LimbIK components run after of VRIK using the IKExecutionOrder component or by updating the solvers manually via ik.solver.Update() in the correct order;

    Best,
    Pärtel
     
  21. cloverme

    cloverme

    Joined:
    Apr 6, 2018
    Posts:
    200
    Thanks much appreciated. I made the mistake of trying Unity's Animation Rigging package for a segment of work I was doing. I can't believe how convoluted it was to try to blend in IK within the armature structure. There's a misconception that just because it's made by Unity it has to be better, it wasn't. Not only was the Rig/Multi-Aim difficult to setup, it gave a really poor result. However, I used FinalIK's AimIK & Second Hand on Gun components, it was simple, easy, and gave a much better result. Even though FinalIK is several years old now, it's still 100x better than Unity IK's solution of today. That and you still support it! Thank you.
     
  22. Giantbean

    Giantbean

    Joined:
    Dec 13, 2012
    Posts:
    144
    Thanks I will take a look at all of these. I am using the Animated mode and extending the 8 direction animator and I have implemented grounder with LimbIK and the IKExecutionOrder as seen in the demo. That seems to turn off the VRIK leg solver while still allowing the arms to follow the controllers but now the body sits in the ground at hip level?

    Edit. For some reason the grounder didn't have zeroed out transforms. Archievr on the Discord helped me locate and solve the issue.
     
    Last edited: Jul 20, 2022
  23. h8476532

    h8476532

    Joined:
    Mar 14, 2022
    Posts:
    17
    Excuse me, Sir!
    Can you suggest the robotic arm ik that can find in the unity asset store?
     
  24. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey, thank you very much for dropping by to say that, much appreciated!! :D

    Hey,
    Actually I never tried any of the other packages myself, so can't help you with that, sorry.

    Best,
    Pärtel
     
  25. Giantbean

    Giantbean

    Joined:
    Dec 13, 2012
    Posts:
    144
    Is there a script to set the VRIK Arm Length Mlp and Leg Length Mlp dynamically. Like having the player stand in a natural pose or a T pose and press a button on the controller to stretch the limbs to match based on the positing of the HMD and controllers? Or better yet typing in the players height to set the avatar limb length incase they are playing without controllers (i.e using hand tracking)?
     
  26. h8476532

    h8476532

    Joined:
    Mar 14, 2022
    Posts:
    17
    Thank you for your reply !!

    Best regards,

    Tony
     
  27. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey, don't have a script for that, sorry.
    But instead of asking the player to stand in T pose and making some fancy calculations that might easily fail, you might want to just give them a couple of sliders to adjust their arm/leg lengths and avatar scale manually in the avatar customization scene or somewhere in the settings.

    Best,
    Pärtel
     
  28. Giantbean

    Giantbean

    Joined:
    Dec 13, 2012
    Posts:
    144
    Good call. Thanks.
     
  29. shma_unity

    shma_unity

    Joined:
    Jun 13, 2018
    Posts:
    118
    I tracked down the source of a weird issue I've been getting.
    I have an animation with the character laying on their back. I made a system where each effector has a target transform, so I can use the same animation for multiple purposes.
    However, using it on the feet, the legs suddenly bent sideways or otherwise completely wrong.
    I tried everything from adjusting orientation to different times to set the target, but it kept happening. Then I created a new AnimatiorController and put in the same animation, and suddenly it worked without problems.
    The only difference I could spot between the controllers was that on the new one, "Foot IK" had been set to on, which is apparently fixing the issue.

    I looked up what the setting actually means and only found:

    I'm still not exactly sure why this setting fixes leg orientation in FinalIK, though. Let me know if you need a video of the issue happening.
     
  30. UnityRocksAlt

    UnityRocksAlt

    Joined:
    Dec 28, 2015
    Posts:
    157
    Hi, I use Unity 2017.4, is it possible for me to get the old version that supports it? Also, you can AIM IK with generic animation that has human bones, right?
     
  31. UnityRocksAlt

    UnityRocksAlt

    Joined:
    Dec 28, 2015
    Posts:
    157
    Ok, I had a older version and it works. The bone thing was funny, I needed to make some adjustments as I used Puppet3D. Now, just curious, assume a person goes prone, is there a way to make him lay on the ground, do I need to make targets the ground raycast position?
     
  32. UnityRocksAlt

    UnityRocksAlt

    Joined:
    Dec 28, 2015
    Posts:
    157
    Regardless, your asset is amazing. I think I will just make him align to ground angle.
     
  33. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    Foot IK does have an effect on Final IK. FullBodyBipedIK tries to maintain the animated bending direction of the limbs. Foot IK applies an internal IK pass on the legs to fix Humanoid retargeting issues and make the position of the feet match with the original source (rig used by the animation clip). Otherwise rigs with different leg bone lengths would have the feet going through the ground at some points. That IK pass sometimes changes thigh twist rotation so it will also change how it will look post-FBBIK. If it looks goo with IK pass enabled, I suggest you to keep that enabled. Or add Bend Goal objects and set Bend Goal Weight to 1 to get full control over where the knees point at.

    Best,
    Pärtel
     
    shma_unity likes this.
  34. Rail9

    Rail9

    Joined:
    Feb 21, 2020
    Posts:
    28
    Hello.

    I am trying to build multiplayer in PUN2 based on this PUN demo, but the NetworkPlater script in the demo is not attached anywhere.

    https://www.dropbox.com/s/mygntstxrhgba2r/VRIK-PUN.unitypackage?dl=0

    So I don't know where to attach the NetworkPlayer script correctly.
    The NetworkManager script is for PUN1, so I have converted it for simple PUN2 and am using it.

    OVRCameraRig is False.
    Of course it has to be turned on to be usable, so I turned it on, but is that correct?
    Or is it intentionally turned off?
     
  35. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    There is a VRIK Photon2 demo in the package too (Plugins/RootMotion/FinalIK/_Integration).

    Best,
    Pärtel
     
  36. Rail9

    Rail9

    Joined:
    Feb 21, 2020
    Posts:
    28
    Assets\VRIK-PUN2\VRIK_PUN_Player.cs(12,18): error CS0101: The namespace 'RootMotion.Demos' already contains a definition for 'VRIK_PUN_Player'

    Assets\VRIK-PUN2\NetworkTransform.cs(12,6): error CS0579: Duplicate 'System.Serializable' attribute

    I am getting about 27 errors like the above, do you know why?
     
  37. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    148
    @Partel-Lang I noticed that there are no more step events inside the VRIK script. How can I hook a sound for each step taken by the ik?
     
  38. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    148
    You probably haven't deleted the imported files from the PUN1 unity package
     
  39. Rail9

    Rail9

    Joined:
    Feb 21, 2020
    Posts:
    28
    Thank You D3m0n

    I forgot to delete the script VRIK_PUN_Player.
    However, due to the following error, multiple players cannot enter the room and the screen will not work properly.

    MissingReferenceException: The object of type 'OVRManager' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    OVRManager.Update () (at Assets/Oculus/VR/Scripts/OVRManager.cs:2120)


    This error has been a problem in my project for a long time and I had no choice but to move to OpenXR development, but when I contacted Oculus, they only told me to ask in the forum.
    I have yet to get an answer on the forum.

    Also, when I port this template to OpenVR, there is a problem with the body orientation rotating with the other players, plus procedural locomotion does not work.
     
  40. digitalbreed

    digitalbreed

    Joined:
    Oct 14, 2017
    Posts:
    12
    Dear Pärtel,

    When pausing an interaction with a Position Offset Y curve in place and after picking up the interaction object, the offset accumulates and the interaction object keeps moving. Is this a bug or am I misunderstanding something?

    Steps to reproduce:

    1. In FBBIK/Interaction scene, change the Button's Position Offset Y curve to be constant >0, e.g. 0.01.
    When you start the scene like this, you will observe a constant offset when pressing the button; that's all fine!)
    2. Tick the "pick up" checkbox for the animation event at t=0.5.
    When you start the scene like this, the button is reparented to the hand as expected; still all fine!)
    3. Add another event at e.g. t=0.6 and tick the "pause" checkbox.
    When you start the scene like this, the button will start moving upwards, dragging the character with it.

    I am using this combination to make my game character grab something, hold it a bit further up after grabbing it, and I want to pause at this point to let the character say something before the interaction resumes. Can you please advise how to work around this issue?

    I am using Final IK 2.1 with Unity 2021.3.7f1.

    Thanks!
     
  41. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,827
    G'day Pärtel!

    Not a huge deal but I'm getting this warning -
    You are trying to create a MonoBehaviour using the 'new' keyword. This is not allowed.
    It seems to be coming from this -
    Code (CSharp):
    1. public IKSolverLimb solver = new IKSolverLimb();
    What would be the best way to get rid of that?
    I'm using Final IK 2.1 with Unity 2021.3.5f1

    Thanks!
    Pete
     
  42. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    148
    Any help for this?
     
  43. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    They are still there, just not visible (there was some unity editor bug with unity events not drawing nicely together with some custom drawers in some unity versions). You can access them via script:

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.Events;
    3. using RootMotion.FinalIK;
    4.  
    5. public class VRIKLocomotionEvents : MonoBehaviour
    6. {
    7.     public VRIK ik;
    8.  
    9.      void Start()
    10.     {
    11.         ik.solver.locomotion.onLeftFootstep.AddListener(new UnityAction(OnLeftFootstep));
    12.     }
    13.  
    14.     void OnLeftFootstep()
    15.     {
    16.         // Play sound or whatever
    17.     }
    18.  
    19. }
    Hey,
    I have no idea what is going on in that project there, I mean the OVRManager thing, did you try reinstalling the oculus plugin? If you can send me that OpenVR port you did, I'd have a closer look.

    Hey,
    Sounds like a bug.. Please try this patch.

    Hey,
    That can't be it, IKSolverLimb is not a MonoBehaviour, so it must be something else. Can you send me a screenshot of the error in the Console?

    Cheers,
    Pärtel
     
  44. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,827
    Opps! :oops: That was something silly I was doing sorry!!
     
  45. digitalbreed

    digitalbreed

    Joined:
    Oct 14, 2017
    Posts:
    12
    It seems to be working as expected now! Thank you for providing a patch!
     
  46. Rail9

    Rail9

    Joined:
    Feb 21, 2020
    Posts:
    28
    The Oculus issue was resolved by upgrading to a newer version.

    The part where the body said that when using OpenXR, the remote and local rotations rotated the same way was also resolved by connecting online with a build on Quest and a playback in the editor, perhaps because we were doing the online verification on the same PC

    However, the object to which the movement script is attached (OVRCameraRig) is described in the script to be hidden for the remote, so when the character jumps, the VRIK-attached character does not follow the CameraRig This is the reason why CameraRig is not being used.

    Therefore, instead of deleting the CameraRig, we deleted only the remote side of the components attached to the CameraRig, created a new Empty object in the CameraRig, and placed the hand and camera objects in its child elements.

    However, the position of the character's body is bent so that it is pulled to the location where it was first spawned, and when jumping, the body itself does not rise into the air, only making a motion of raising the hand.

    Here is a video of the specific situation


    Also, if I hold an object with a RigidBody on it in my hand, IK is not synchronized.

    Is there a solution?
     
    Last edited: Aug 15, 2022
  47. Partel-Lang

    Partel-Lang

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

    To get your remote avatar jumping like the local one does, you'll have to sync the Y position of the avatar.
    Not sure why the body is bending to that spawn position, when you select the root of the avatar, do you see it moving along with the controllers? Or maybe you don't have Pelvis Position Weight set to 0?
    About holding a rigidbody, is it working locally and just not remotely? Probably need to sync IK target positions/rotations, not controller positions/rotations.

    Best,
    Pärtel
     
  48. botove

    botove

    Joined:
    Apr 10, 2015
    Posts:
    52
    Hello, have problem using Biped IK component in parent prefab - prefab variants workflow. I have character prefab with empty biped component and then have them setup for each prefab variant. For some reason prefab variants IK breaks this way and seems it's related to prefab variants characters default pose.
     
    Last edited: Aug 18, 2022
  49. Rail9

    Rail9

    Joined:
    Feb 21, 2020
    Posts:
    28
    ThankYou Partel

    In order to make the character follow the object with the RigidBody attached, the following script was attached to the character, which caused the character to bend at the waist.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class PlayerTransform : MonoBehaviour
    6. {
    7.     public GameObject playerObj;
    8.  
    9.     public float height;
    10.  
    11.     private void Update()
    12.     {
    13.         transform.position = playerObj.transform.position + new Vector3(0, height, 0);
    14.     }
    15. }

    Also, the problem of IK not synchronizing when holding the RigidBody object was solved by attaching the PhotonTransformView and RigidBodyView.

    However, I cannot figure out how to synchronize the Y axis position other than the Transform update script above.

    The above script was able to jump to the VRIK synchronization process I created, but Ik did not work, so I used this Demo, but how should I implement jump synchronization?
     
  50. holy_3051

    holy_3051

    Joined:
    Jul 26, 2013
    Posts:
    3
    I'm making a basket ball game with dynamic characters (UMA), so how can I achieve to make every character matches with the boncing ball animation. I have two options, to make the ball adpats to the character animation, or make the character adapts to the ball animation. I don't want the hand to copy the position of the ball like in the interaction system examples. I just want to add an offset to the hand based on the ball position, not to lock the bone position to the ball.

    How do I achieve this?
    Or what do you recommend to make it work properly.
     

    Attached Files: