Search Unity

Question Syncing prop animation with humanoid animation

Discussion in 'Animation' started by MojopinStudios, Apr 20, 2023.

  1. MojopinStudios

    MojopinStudios

    Joined:
    Jan 9, 2013
    Posts:
    21
    Is there a definitive way to sync animations in humanoid animations? As an example, we have a running bounce ball animation. We have a bone in the animation specifically for the ball movement. This works if the animation is setup as Generic. However, when humanoid the ball bone is not mapped and therefore it does not have any movement.

    I have tried other approaches, such as creating an animation specifically for the ball and triggering it with an animation event at the correct frame, but this has an issue where it is not always synced. The animation event isn't guaranteed to be frame perfect so sometimes the ball animation is triggered a frame or 2 behind the character animation. I could have a script that reads the frame of the animation and syncs exactly with offset, but I can't help but feel this may be an unneccessary step. Happy to be corrected.

    I feel like I am missing a very obvious solution, it seems like a very common problem but being unable to pull extra bone animation from a humanoid animation seems like a big restriction.

    How is this approached?
     
  2. Yuchen_Chang

    Yuchen_Chang

    Joined:
    Apr 24, 2020
    Posts:
    126
    Hello!
    I'm not sure if I understand the situation right. Is it "There's a human 3d model with an additional ball model in a single fbx, and when import as Humanoid, animation of the ball disappears"?
    If so, you can go to your fbx > Animation tab > Mask > Transform > [Toggle All], then the ball's animation should be imported as well.
    The reason is, default Humanoid will only import human bones, so you have to specify which additional bone you want to import.

    AnimationImport_Mask.png

    Or, if you have multiple animations, you can create a Avatar Mask asset (right click at project window), set it's source as your model's avatar (should be created in the Rig tab if is Humanoid), and set the Animation Mask Definition to Copy From Other Mask, and select the mask you just created.

    AvatarMaskAsset.png

    (I'm not 100% sure if it's right. If I'm wrong, please tell me)
     
    Last edited: Apr 21, 2023