Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. 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

Feedback Simple animation - please keep legacy!

Discussion in 'Animation' started by andyz, Jan 19, 2021.

  1. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    1,653
    I try to avoid animation!
    But I have to program some simple single-animations on a gameObject and I do not see how you would do this without legacy animation.
    Because if all you have is 1 non-bipedal animation clip that I want to play/pause, maybe reverse, maybe set its time value to scrub back & forwards if something special!! (do-able/done, if not as simple as expected...)

    Also if you want to do a simple/fast/retro game, you probably do not want to mess with mecanim, at least while prototyping.

    Is there anyway as simple as Legacy with Playables API, Mecanim etc?
    Will legacy be kept?
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    1,420
    Check out Animancer (link in my signature). It's far more flexible than even the Legacy system and also has a Solo Animation component if literally all you want is to play and control one animation.

    Also, last I heard, the official stance was that Legacy will not be removed unless a newer system can do everything better. I doubt they'll actually keep maintaining it indefinitely, but I would expect a few more years at least.
     
  3. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    1,653
    I have probably already done what your solo animation component does - It seems pointless to use non-legacy for a simple mechanical animation as Playables seems complex
    Is the rest of your plugin based around the Playables API underneath?
     
  4. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    1,420
    The Solo Animation component is useful for testing because you can control the animation directly in the Inspector, but it won't really add much if you're already using Legacy for that. The only thing I've actually used it for in a real project was some Humanoid background characters since I needed the ability to retarget the animation.

    And yeah, it's all based on the Playables API.
     
    andyz likes this.
  5. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    1,653
    Animation and AnimationState seem to be flawed in that I can not get the current state of an animation without tracking it constantly/adding events etc.
    An AnimationState will have its NormalizedTime reverted to 0 when an animation has finished, even if not a looping animation! So I can not determine the current state of an animated mesh - it could be paused at some point along an animation or at its end.
     
  6. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    1,420
    In Animancer (an the Playables API), time will keep increasing after the animation finishes, regardless of whether it's looping or not. There are also other properties like IsPlaying and Weight that you can use to check whatever details you need.
     
unityunity