- Home /
Animation (Legacy) vs Animator (New).
So, let me get this straight:
Using Animation Component (Legacy):
animation[clip.name].speed = whatever;
animation.Play(clip.name);
Done.
Using Animator Component (New):
Pass animatorcontroller to animator component.
Pass animation clip to animation state?
Add a "hash" of the "state" of the animation clip file, hash being an integer.
Create a "AnimatorStateInfo" and set to the animator.stateinfo.
Compare animation states instead of game states, by string name (bye bye intellisense), and be sure to remember and include the "layers" of your states (also by string name of course).
animator.SetFloat("Speed", value) //Setting vars of animator by string name and type (again, bye bye intellisense).
animator.SetTrigger(animationClipStateHashInt) instead of animation.Play(animationClip.name);
Done. (Probably)
And I haven't even gotten into the visual animation state editor, but I'm assuming (and hoping) that's just a way for non-coders to script animations in.
Unity says mecanim (Animator) is supposed to replace the legacy Animation system.
This IS how the new system works, right? The unity docs and tutorials show how to set up the animation system but not how to actually use it (how to simply play a clip). The one tut I found to do this had this ridiculously long process.
How is this an improvement? I can't do even the most simple of animations now without a ridiculously long, convoluted, and tedius process.
I have the same feeling. I never used the Animator component becasue after a few looks at the API and tutorials I somehow thought it'd be far too much work for comparatively simple animation playing. I have only usd the normal Animation so far and got everything out of it I wanted, even with some more complex stuff like Blending, $$anonymous$$ixingTransform etc.
Same thing here. I only used Animator one time to make my Helicopter's animations. Do you believe that it ruined my job and with just a simple script and some animation clips i did everything that i wanted.
The ONLY thing that you can't do with animation clip is to rotate wheels and rotors at the same time that a vehicle moves.
Answer by Xarbrough · Apr 06, 2015 at 12:47 AM
You might be thinking about this from the wrong perspective. The Animator is great for building a whole state machine that doesn't need any code logic form your side to run. Comparing AnimatorStateInfo, setting speed and layers through code is not necessary, if you use Mecanims features (at least in the majority of cases). But yea, if you only want to play a single clip, continue to use Legacy, it'll stick around for quite a while and honestly, you can get a free script from the asset store that does the same thing, if Unity ever removes it. For anything that requires States and Transitions, Mecanim will do a great job without much coding. And of course, if you are comfortable scripting your own state machine, you might as well do just that.
Here's my sample workflow: Create a new animation for your selected GO (Animator created automatically and all hooked up) Set states and transitions via parameters/blend trees Create hashes Set Params in script.
Doesn't sound too painful. And if you do need to set all those floats and compare states in your code, you would have to do it anyway when using Legacy, right, so at least it wouldn't be a step back, I think.
Answer by aFeesh · Feb 12, 2017 at 12:59 AM
Taking your original example of:
animation[clip.name].speed = whatever; animation.Play(clip.name);
With the new animator you can do this with 0 lines of code. Create an attach an AnimatorController onto your object. Drag in your animation into the controller and set it the speed. Done.
AnimatorController is far superior.
Answer by Medusa-Zenovka · Jul 18, 2016 at 06:56 PM
I played around with both systems and for my RTS game Animations turned out to be the more flexible system because you can a lot more with it. Animator is way too static since you can not add animations through scripts which is important for my modding support system - otherwise I probably would prefer Animator instead.
Can you add me on facebook or talk thru email, i wanna talk about that modding support and how you did it, you can contact me here: 3010lk@gmail.com, thanks in advance :D
Answer by gosolo2 · Oct 16, 2016 at 12:18 PM
I have been using Legacy with Playmaker and it is really easy. With Animator and Playmaker it is very annoying, long... tedious process.
Answer by theANMATOR2b · Oct 16, 2016 at 11:23 PM
I also used Animator with Playmaker. Create everything in mecanim and use Playmaker for input controls and binding. Very simple - enjoyable process.
Your answer
Follow this Question
Related Questions
[Unity 4.3] Skinned legacy animations do not work 1 Answer
How to use mecanim to play specific animation clips when public static int condition is reached? 2 Answers
Using root motion scripting for specific animations 1 Answer
Should I use playables, mecanim, or legacy to create keys and clips ? 0 Answers