Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question 2d animation - replacing a specific piece of an animation

Discussion in 'Animation' started by Inksuki, Jan 30, 2023.

  1. Inksuki

    Inksuki

    Joined:
    Mar 17, 2022
    Posts:
    20
    Hello! Is there a way to "surgically" replace only a specific piece of an animation?

    For instance, I have in my animation, a character sprite, and an anchor position for something the character is holding, and an image of the actual item being held. See screen shot:

    upload_2023-1-30_18-30-53.png

    Is it possible to use an override controller or some other means to swap out the sprites for the item being held (RodEndPoint) in the image, but not mess with the anchor points or the sprite for the character?

    I've used Animation Override Controllers in the past to swap out components of an animation stack, but only when I'm replacing the entire animation.

    I attempted to separate this animation into two animatoins, but had limited success, and then the animations weren't synching correctly.

    Add to this that I have over 50 different character skins, trying to make permutations of each character skin holding each item is obviously an insane task.

    I'm hoping that this is doable, it grew this way during development because this animation is involved with some pretty annoying line math and line renderer drawing. :(

    What would be the best method to accomplish what I'm trying?
     

    Attached Files:

  2. Inksuki

    Inksuki

    Joined:
    Mar 17, 2022
    Posts:
    20
    I figured this out after taking a long walk and a step back and reassessing.

    I broke the animations apart (again) and just set boolean triggers for the different events. Now when i trigger the parent animation, i can trigger the item animation in the same frame with a separate Animator.setbool, and all works well. Now to go back through and realign all the pivot points.

    Should've followed the KISS principle from the get-go. :)