Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Mirroring an animation

Discussion in 'Animation' started by FestusVG, Jun 3, 2017.

  1. FestusVG

    FestusVG

    Joined:
    May 11, 2017
    Posts:
    5
    Hi!
    Is it possible to make a perfect copy of an animation with some curves reversed? I.E. if I'm having a sword that slashes to the right, could I somehow mirror a copy of this animation to have the exact same movement, but to the left?


    Thanks for your help.
     
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,782
    A simple google search reveals the answer you require.
     
  3. FestusVG

    FestusVG

    Joined:
    May 11, 2017
    Posts:
    5
    Then perhaps I'm searching for the wrong thing, because I've been at it the whole day, and I'm unable to find anything solid.
     
  4. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,782
    Wait - might need to clarify
    Are you looking to keep the animation you have but change the sword swing right to sword swing left. Still keeping the same animation - in the same hand?
    OR
    Mirror the entire animation so the right sword swing (with the right hand) is mirrored and the resulting animation is a left sword swing (with the left hand).

    If #1 - afaik - no that is not doable in Unity. It's a simple thing in 3D that would result in a new animation, but not within Unity.
    If #2 - yes - a very simple process that is revealed in the top 5 google search results.
     
  5. FestusVG

    FestusVG

    Joined:
    May 11, 2017
    Posts:
    5
    There are no hands, it's a floating sword, in 2D. I'm aware that you can easily mirror humanoid-based animations in 3D, but this is not the case. Perhaps posting a picture will clear things up. Here goes:

    I want the little floating sword to have a set of left-side and right-side animations (for when the character turns around). The sword is a child object of the player cube, has it's own separate animator. The question is whether I'll be able to somehow copy and mirror the swords animations along player's Y axis (since I already have all the right-side animations), or would I have to manually set all the "lefties" up from scratch?

    Thanks.
     
  6. FestusVG

    FestusVG

    Joined:
    May 11, 2017
    Posts:
    5
    Figured it out.
    Turns out, when you flip the parent object (X axis * -1), the child object AND it's animations get flipped, too. I was so convinced that was too simple to work, that I didn't even try it in the first place. Silly me.
     
    theANMATOR2b likes this.
  7. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,782
    Glad you solved and updated. Great for sharing. ;)
     
  8. Macqueen

    Macqueen

    Joined:
    Aug 29, 2013
    Posts:
    1
    gotta love the just google it when they become top result smh
     
  9. hyyrylainentommi

    hyyrylainentommi

    Joined:
    Nov 16, 2020
    Posts:
    1
    Especially when this was now the top google result for me
     
unityunity