Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
8
Question by PsychoDuckArcade · Apr 05, 2015 at 08:32 PM · animationanimatormecanimlegacyclip

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.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Cherno · Apr 05, 2015 at 10:06 PM -1
Share

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.

avatar image Zitoox · Oct 16, 2016 at 11:46 PM 0
Share

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.

5 Replies

· Add your reply
  • Sort: 
avatar image
10
Best Answer

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image PixelSpartan · Nov 12, 2016 at 06:44 PM 0
Share

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

avatar image
0

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

27 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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

Can i use mecanim animator while using legacy? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges