Search Unity

How do I get correct looped animations?

Discussion in 'Animation' started by Carl_Slate, May 19, 2021.

  1. Carl_Slate

    Carl_Slate

    Joined:
    May 27, 2020
    Posts:
    12
    Hi. As the subject says, how does one get loop animations into unity without them getting butchered?



    This sort of thing always happens when the "loop pose" box is checked. I have tried turning off all optimization and reprocessing options, and I have tried key-framing all frames around the beginning and end of the loop (hoping it would help Unity generate the smoothed loop more accurately), and I have tried breaking animations up each into their own exclusive .fbx files, but no solution so far.

    I know the data in the fbx file is correct because it displays correctly in Unity when the loop pose box is not checked.
    I am using unity 2019.4.26. Can someone help with this?
     
    Last edited: May 19, 2021
  2. Carl_Slate

    Carl_Slate

    Joined:
    May 27, 2020
    Posts:
    12
    I still haven't found a solution to this, but with some experimenting, I have learned some things that are helpful for reducing the severity of the effect. Here's what I've found, in case it is helpful to anyone else:

    The problem seems to be that Unity is just garbage at importing animations. Somehow or other, bones don't get read or updated during playback in Unity the same as their original data. So, you can't simply set up a seamless loop animation in your 3D software and use that frame range to make a similar seamless loop in Unity. Instead, you have to either add some overlapping frames onto the beginning or end, or shorten it by a few frames, for Unity's loop method to do minimal damage.

    Which will be necessary may depend uniquely on your specific animation, and you'll have to play around with it to find the right range. Sometimes the right range can be so sensitive that you have to change it by a few thousandths of a frame. I found on a few animations that a change of 0.005 made dramatic difference in the precision, but it doesn't support precision on ten-thousandths. 0.000X will always get rounded down.

    As for using the original looped animation range without "loop pose", that doesn't work either, for the same reason. The frames may loop seamlessly with their original data without needing any special help, but Unity will not play them back matching that data and the loops will not be seamless.

    As far as I can tell now, there is apparently no way to make animation playback in unity match the original data. If anybody has some more-accurate info that may help to demystify this issue, please share?
     
    Last edited: May 23, 2021