Answered

Prevent generic object from moving under humanoid rig with root motion

Megakeep 4 years ago updated by Peter - Soxware Developer 4 years ago 4

Hello,

I have a human mesh with a humanoid rig and a car prop. The UMotion project is of humanoid type. I want to animate the human entering the car and drive off. From previous posts I understood that any generic objects need to be under the hips. I've done that but if I apply any root motion on the humanoid the generic object will move as well.

Image 624

Is there a way to keep the generic object frozen in place when applying root motion to the humanoid rig and only move it when I specifically want it to? (i.e. stays in place until the human enters the car then both the human and car will move in the same direction)

I've also seen suggestion for other related issues with IK pinning and child of constraint but I'm not sure how to do this.

Thank you and best regards.

UMotion Version:
1.24p01
Unity Version:
2018.4.20f1

Answer

Answer
Answered

Hi Megakeep,

thank you very much for reaching out.

I honestly wouldn't approach this situation like this. If you are creating this for a static cut-scene or a movie, make your character "generic". "Humanoid" only has advantages if you want to use one animation on multiple characters (animation retargeting) but comes with the additional difficulties and lower animation quality. Generic plays an animation exactly as you authored it (best quality) and works very straight forward. Then create an empty "Root" GameObject and attach an Animator component to it. Make the character and the car a child of the new "Root" and remove the Animator components from the character/car. Now create a "generic" UMotion Project for and assign your "Root" to the Pose Editor. You can now animate both the car and the human and they still move independently.


For more information regarding IK, Child-Of and IK Pinning, please check out the related video tutorials in the video tutorial chapter of the manual.


Another way would be to animate both objects (the car and the character) independently and use Unity Timeline to synchronize them. UMotion's "Sync" button allows you to edit animations in the Unity Timeline context (demo video). More information can be found in the "Unity Timeline Integration" chapter in the manual.


If you are doing a game where the player controls the character at runtime (i.e. walks near to the car, then presses a button to enter the car), this is a whole different story and can't be approached very well with regular "static" animations. You would need path finding to move the character close enough to the door, then use runtime IK solutions like Unity's new IK rigging package to adapt the animation to any offsets that result in different player positions etc. Inspect the way how the GTA titles approach this problem.


Let me know if you have any follow-up questions.

Best regards,
Peter

    GOOD, I'M SATISFIED
    Satisfaction mark by Megakeep 4 years ago

    I've done more digging and found the child of constraint with IK pinning option is the solution to keep the car in place when applying root motion to the humanoid. I guess this question can be closed.

    Answer
    Answered

    Hi Megakeep,

    thank you very much for reaching out.

    I honestly wouldn't approach this situation like this. If you are creating this for a static cut-scene or a movie, make your character "generic". "Humanoid" only has advantages if you want to use one animation on multiple characters (animation retargeting) but comes with the additional difficulties and lower animation quality. Generic plays an animation exactly as you authored it (best quality) and works very straight forward. Then create an empty "Root" GameObject and attach an Animator component to it. Make the character and the car a child of the new "Root" and remove the Animator components from the character/car. Now create a "generic" UMotion Project for and assign your "Root" to the Pose Editor. You can now animate both the car and the human and they still move independently.


    For more information regarding IK, Child-Of and IK Pinning, please check out the related video tutorials in the video tutorial chapter of the manual.


    Another way would be to animate both objects (the car and the character) independently and use Unity Timeline to synchronize them. UMotion's "Sync" button allows you to edit animations in the Unity Timeline context (demo video). More information can be found in the "Unity Timeline Integration" chapter in the manual.


    If you are doing a game where the player controls the character at runtime (i.e. walks near to the car, then presses a button to enter the car), this is a whole different story and can't be approached very well with regular "static" animations. You would need path finding to move the character close enough to the door, then use runtime IK solutions like Unity's new IK rigging package to adapt the animation to any offsets that result in different player positions etc. Inspect the way how the GTA titles approach this problem.


    Let me know if you have any follow-up questions.

    Best regards,
    Peter

      I think importing the humanoid rig along with other generic objects to a generic UMotion project might be better, but then I think I will need to manually create the IK rig for any humanoids. I could not get the Unity Timeline to work as I intended and seems to crash when entering/exiting play mode depending on animation clips. Root motion is finicky with IK pinning especially when turning groups of bones for humanoids in specific ways (when rotated 180 degrees the pinned IK handle with bones does not stay in place completely, maybe due to the IK pole). I just do static animations, bake all root motion then export them in a game called VRChat.

      Many thanks for your detailed answer.

      but then I think I will need to manually create the IK rig for any humanoids.

      In UMotion you can still use the IK setup wizard for creating the IK rig for your human character (even if being generic). Just select the hand and foot bones for the appropriate fields in the "Human IK" section of the IK setup wizard (for humanoid characters, the hand and foot bones can be automatically detected):

      I just do static animations, bake all root motion then export them in a game called VRChat.

      That's great. Then the first method (generic animation with a new root animator component) is probably best fitting.

      Have fun creating your animations and if you have any questions related to UMotion, feel free to ask on this support forum.

      Best regards,
      Peter