Search Unity

Legacy or no Legacy animation

Discussion in 'General Discussion' started by D-Coy, Apr 18, 2020.

Thread Status:
Not open for further replies.
  1. D-Coy

    D-Coy

    Joined:
    Jun 2, 2013
    Posts:
    16
    Hi,
    Ive run into a really annoying issue.
    Ive got a 2 frame anim that I have made in the (Legacy) animation window (in the unity version Im currently using) for a light switch, switching on and off.
    The animation works fine and is triggered in game as it should. But Im getting this warning "The AnimationClip '***' used by the Animation component '***' must be marked as Legacy".
    So I go to Debug mode for the animation, toggle the Legacy button and I then get "Legacy AnimationClips are not allowed in Animator Controllers. UnityEngine.GUIUtility:processEvent(Int32, IntPtr)" and the animation breaks, even if I turn off the Legacy option.
    This is really frustrating as it works fine and I have animated other assets like this with no problem.

    Any solutions here for this? I really just want to get rid of this warning, but maybe theres something that is more efficient/better that someone can advise (to animate 2 frames). Im not great with the animation side of Unity, but this seems like a practical way to do things that are single events.

    Thanks
     
  2. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,853
    It is two positions or rotations. Write a script. Make it so you can drop another object in and define position and or rotation per trigger event and a conditional for triggering.
     
  3. D-Coy

    D-Coy

    Joined:
    Jun 2, 2013
    Posts:
    16
    Hmm, thats a very good point. Ill do that. Cheers.
    Its still pretty frustrating to get errors for something that works (and the unity solution breaks it), Ill want to use the Animation window at some point for somethings a little more complicated and Im not sure why its flaked out on this anim.
    Anyway, your suggestion is very helpful.
    Thanks again.
     
    ippdev likes this.
  4. Owen-Reynolds

    Owen-Reynolds

    Joined:
    Feb 15, 2012
    Posts:
    1,998
    Not sure if this is an issue, but the Legacy system used
    Animation
    . They were played using lines in scripts. The new mechanon system uses
    Animator
    . Sometimes paying attention to "tion" vs. "tor" lets you know which system they're talking about.
     
  5. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    The Animation window is not legacy. The Animation component is... ish. There's a lot of backstory there, as it was on it's way to deprecation, but Unity realized that the Animation component is so much faster than any other way of playing animation in-engine that they couldn't really deprecate it.

    But, yeah, the "legacy" flag has to be on animation clips in order to be played with the Animation component, and have to not be on clips to be played by the Animator. So you either have to stick to one, or create two versions of the clip.
     
Thread Status:
Not open for further replies.