Answered

Child-of looks perfect in Umotion but looks differently in Unity Timeline

Sang Hendrix 3 years ago updated by Peter - Soxware Developer 3 years ago 1

Hi guys. So I'm creating an animation of a character holding a gun. It looks perfect in Clip Editor but when I exported to Anim file and ran it on Unity Timeline, it looked like the second pic. The gun was off position and I don't know why.

Image 903

Clip Editor

Image 904

Unity Timeline

UMotion Version:
1.26p02
Unity Version:
2021.1.20f1

Answer

Answer
Answered

Hi Sang,
thank you very much for your support request.

The child-of constraint only "fakes" changing the parent by generating key frames that make the pistol act as if it's a child of a different parent. (This is needed because it's technically not possible to alter the parent/child relationship from within an animation.) This "fake" works as long as the real parent isn't moved to a different spot than it was while exporting the animation. It's also necessary that your hand is in the same spot again in the exported animation. If your character uses the humanoid animation system, it is not guaranteed that your hands end up in the same spot (due to the re-targeting algorithm of humanoid).

Maybe you are using an override layer in your timeline that alters some of the pre-baked positions? When you play the exported animation directly on your character (not using Unity Timeline, does it work then)?


My recommendations:

If you're using humanoid, I recommend using "generic" instead. Generic is playing an animation 1:1 as you've authored it while humanoid uses animation re-targeting which only "approximates" your authored animation (here's a good explanation how humanoid works: https://blog.unity.com/technology/mecanim-humanoids).
Using humanoid will give you lots of headache if your trying to do precise hand interactions that are close to the camera (thus very visible to the viewer) because humanoid's "lossy" nature (due to the re-targeting) introduces lots of small position errors.

To switch to generic, simply duplicate your source character. Configure it as generic. Create a new UMotion project of type generic for your generic character. Import the old humanoid UMotion project file (the *.asset file, not the exported animations!). This results in a new project of type generic with all your previously created animation. Export the animations and use them on your generic character.

Let me know in case you need any further help.

Best regards,
Peter

    GOOD, I'M SATISFIED
    Satisfaction mark by Sang Hendrix 3 years ago
    Answer
    Answered

    Hi Sang,
    thank you very much for your support request.

    The child-of constraint only "fakes" changing the parent by generating key frames that make the pistol act as if it's a child of a different parent. (This is needed because it's technically not possible to alter the parent/child relationship from within an animation.) This "fake" works as long as the real parent isn't moved to a different spot than it was while exporting the animation. It's also necessary that your hand is in the same spot again in the exported animation. If your character uses the humanoid animation system, it is not guaranteed that your hands end up in the same spot (due to the re-targeting algorithm of humanoid).

    Maybe you are using an override layer in your timeline that alters some of the pre-baked positions? When you play the exported animation directly on your character (not using Unity Timeline, does it work then)?


    My recommendations:

    If you're using humanoid, I recommend using "generic" instead. Generic is playing an animation 1:1 as you've authored it while humanoid uses animation re-targeting which only "approximates" your authored animation (here's a good explanation how humanoid works: https://blog.unity.com/technology/mecanim-humanoids).
    Using humanoid will give you lots of headache if your trying to do precise hand interactions that are close to the camera (thus very visible to the viewer) because humanoid's "lossy" nature (due to the re-targeting) introduces lots of small position errors.

    To switch to generic, simply duplicate your source character. Configure it as generic. Create a new UMotion project of type generic for your generic character. Import the old humanoid UMotion project file (the *.asset file, not the exported animations!). This results in a new project of type generic with all your previously created animation. Export the animations and use them on your generic character.

    Let me know in case you need any further help.

    Best regards,
    Peter