Answered

how to attach staff with two hands hold to an animation

eetu 9 months ago updated 4 weeks ago 5

I have an old man leaning to a staff with two hands. I have also an animation from Mixamo that would suite this purpose, but I need to set the staff somehow to the rig so that I could move it little bit independently, but the hands would follow. I just can't figure out how to set the the staff and hand rigs to it.

UMotion Version:
1.29
Unity Version:
2022.3.10

Answer

Answer
but what I actually want is that the point of the staff should stay in one place

Could you further elaborate what you mean by that?

If I try to set the staff to the root, I get a complaint that it doesn't have a bone...

For characters configured as humanoid, Unity requires that any animated object must be a child of a humanoid bone. So you would need to make your staff at least a child of the hips bone. You can then parent the two IK handles of the right and left hand to the staff so that both hands follow the staff as you move it. Please note that humanoid adds re-targeting errors to the mix, meaning that at runtime it can happen that their is a (usually small) positional offset between the hands and the staff. You do not have that issue when using generic.


Best regards,
Peter

Answered

Hi,
thank you very much for your support request.

You need two things for this to work: IK and the Child-Of constraint.

  1. I would make the staff a child of the e.g. right hand in your hierarchy. That way you only need to focus on making the other hand stick to the staff.
  2. Setup IK for your character using the IK setup wizard (in config mode)
  3. Stay in config mode and select the IK target of the left hand (the wire cube). Open the constraints tab and disable the "IK Pinning mode". This changes the child-of constraint back into the regular child-of mode where you can select any arbitrary parent. In IK pinning mode, you can only choose between pinned (i.e. world space is parent) or not pinned.
    Image 1341
  4. Return to pose mode, select the wire cube of the left hand. Under "Channels" Change the "FK/IK blend" slider to 1 (=IK). Move the wire cube to the staff. Also under "Channels" change the parent to be the staff. If you now move the staff, the hand should follow.
  5. Make sure to create keyframes for all your changes.

Please let me know in case you have any follow-up questions.

PS: When working with the child-of constraint, you should be aware of some common pitfalls: https://www.soxware.com/umotion-manual/ProLesson3.html

https://www.soxware.com/umotion-manual/ChildOf.html

Best regards,
Peter

Hi, I got it to work so that the staff follows the right hand, but what I actually want is that the point of the staff should stay in one place - it should rotate a bit to follow the character. Any ideas? If I try to set the staff to the root, I get a complaint that it doesn't have a bone...

Or would it just be more easier to add the staff to the character in Blender?

Answer
but what I actually want is that the point of the staff should stay in one place

Could you further elaborate what you mean by that?

If I try to set the staff to the root, I get a complaint that it doesn't have a bone...

For characters configured as humanoid, Unity requires that any animated object must be a child of a humanoid bone. So you would need to make your staff at least a child of the hips bone. You can then parent the two IK handles of the right and left hand to the staff so that both hands follow the staff as you move it. Please note that humanoid adds re-targeting errors to the mix, meaning that at runtime it can happen that their is a (usually small) positional offset between the hands and the staff. You do not have that issue when using generic.


Best regards,
Peter

Thank you Peter for this tutorial!

I think it's very important case - because it cover all two-handed objects interaction animations.


I think it should be added to PRO-tutorial on YouTube.
And this case is different from Child-of-constaint tutorial.

I have some experience with UMotion, but it's not easy to follow written tutorial))

Regards,

Alex Mas