I’m trying to convert a simple arm IK setup in our VR project to something based on the Animation Rigging package. Our current setup evaluates if the arms of the model are long enough to reach the target (driven by hand tracking of the user), and if not, it allows for a bit of bone stretch by modifying the local positions of the relevant joints in the hierarchy.
I’ve tried to integrate that principle in what is basically a modification of the standard Two Bone IK script. I find that while all the updates do seem to happen correctly (from debugging the calculated values), the updated local positions applied to the ReadWriteTransformHandle do not persist. It seems something somewhere resets the Humanoid avatar’s hierarchy to its original definition.
Functionally the same code works fine with making it a non-job, not animation rigging, bog standard bit of Transform manipulation in a MonoBehaviour.
The avatar has an Animator, with a valid avatar, but no active animation. Is the behaviour described above expected? Is there a way to work around this?
When using constraints on a humanoid character, you have to be careful that the changes you make are compatible with humanoid. I’m guessing the local position offset you’ve added in the two bone IK does not convert back to human curves like you would expect, and thus is lost in the final pose. You can refer to my post on the subject that explains it a bit more:
You could try the exact same setup with a generic character instead to see if this would work.
Otherwise, this is a limitation of the humanoid system I’m afraid.
Unfortunately a humanoid character is a requirement for what we do, so that’s unfortunately the end I guess. We can go the route of creating a new Avatar at runtime, but that comes with its own heap of issues and won’t perform well.
I’m working on a similair problem. Also VR also humanoid avatar. While changing the hand position of the avatar is not working, changing the scale of previous components of an Avatar works with Bone IK Constraints. For example it is possible, dependent on the model, to change the local scale of the arm and forearm of a humanoid model, which in turn will stretch the hand position further out. It is not a perfect solution, but it does help in our case.
Hey , I hope you will see this. can you please tell me how did you stretch the arm and forearm? when I try to do that nothing happens, it seems like the two-bone IK constraint just locks the bones attributes to their original setting. I’ve been trying to figure that out for three days now…
I’m able to scale the bones but then the IK doesn’t work very well. Seems like it still has some original settings like fashVR mentioned. Any way to access those settings?
I am trying to do this with a generic rig character.
The animations simply played through an animator controller are able to stretch the limbs using transform position, scaling is at 1, 1, 1 all the time, all fine. But with the animation rigging package I can’t stretch the limbs. I guess because the Two Bone Ik constraint only writes rotation for assigned bones?
Well since I just found a solution for a humanoid avatar: For one of course the Code of the Two Bone IK Constraint Job needs to be modified, but what took me long hours to realize was that to not only control rotation but position too was to Enable the Translate DoF option in the Additional Settings of the Avatar.