Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Animation State Mirroring doesn't work with looping animations?

Discussion in 'Animation' started by DCallaPlayful, Aug 27, 2017.

  1. DCallaPlayful

    DCallaPlayful

    Joined:
    Sep 22, 2015
    Posts:
    2
    I've been able to use the Animation State's "Mirror" functionality on all my non-looping states with great effect. When I try it with a looping animation, the mirror doesn't work and all I get is a bit of animation stutter. I have the Mirror driven by an animation parameter. If I take the offending looping animation clip and set it to no longer be a loop, the mirroring works fine. Am I missing something or is this a bug?

    Also, the looping clip does seem to mirror correctly if I set the mirror flag in the clip itself, but that's not sufficient for my purposes as I need to be able to be able to flip the mirroring on and off at runtime.

    -Rig is Humanoid
    -Tested on Unity 2017.1.0p4
     
  2. RevoltingProductions

    RevoltingProductions

    Joined:
    May 2, 2017
    Posts:
    37
    So what you want to do is create a new clip that is mirrored and use that new clip as your animation.
     
  3. DCallaPlayful

    DCallaPlayful

    Joined:
    Sep 22, 2015
    Posts:
    2
    Thanks for the tip RevoltinProductions. That's exactly what I ended up doing as, hopefully, a temporary solution. Unfortunately that has required me to either duplicate all the states that that need both standard and mirrored versions, or put both clips into a blend tree and ensure that one and only one has any weight. Neither solution is ideal.
     
  4. Gikon

    Gikon

    Joined:
    Sep 24, 2013
    Posts:
    3
    This guy made a script to manually loop his animations so he could mirror the state at runtime:
     
unityunity