Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by Neurus_Ex · Oct 25, 2016 at 09:46 PM · animationunity 5mecanim

What is the way to go for animating simple objects?

Unity has several ways to implement animation of elements on screen, and I don't really know which is the "correct" (best, more generic, most flexible) way to do this.

We have mecanim, which seems to be more oriented towards "things with bones" (i.e. characters) with all the animations graphs and whatnots but that it seems to be the "official way to go" nowadays, the (legacy) animation view, which allows us to make simple clips and play them, and some basic functions to move arond stuff that reminds me of that funny time I messed around with OpenGL.

Most of posts that talk about moving stuff points towars the basic functions, all stuff that points towards the legacy animation view seems to be from 2013 (before the mecanim arrival), and I haven't seen any tutorial oriented towards making siple stuff move around in mecanim.

So, right now, I just want to rotate a cube. Wow. Big deal. But today's cube rotation could be tomorrow spaceship movement, and I hope next week something a bit more interesting or complex.

So, should I try to go for Mecanim to do ultra simple things I've already done with some functions? Does anyone keep using the old animation view?

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 · Oct 26, 2016 at 06:43 PM 0
Share

It's a god question and one that I have asked myself. I handle it ona case-by-case, or rather, project-by-project base. Generally, I try to avoid having different animatio nmethods in one project. Things like simple rotations can be done via code without any animations at all, and for things like doors, if you really want to use animations, the legacy system is more than enough. However, The mecanim state machine is indeed very powerful and if you know that you might be going into more complex behaviors, be it rigged characters or spaceships, then I would recommend taking the plunge and learning how to use mecanim.

avatar image Neurus_Ex Cherno · Oct 31, 2016 at 10:00 AM 0
Share

The thing is that for what I've done, with simple code I had more than enough (displacements, rotations..) but I have a strong feeling that I'm not going the "right" way to do this.

Also, having that bloody legacy animation system does not help neither. Is legacy, but is recommended for some stuff. Then is not legacy. But maybe in some versions they will remove it.

What a mess... thanks for the answers, anyway. I'll stick for now with simple code animation... if in the future I have time to learn mecanim, I'll switch completely. Just in case.

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Anton-Korhonen · Oct 31, 2016 at 03:16 PM

If you only want to translate, scale or rotate an object i would recommend writing a simple script that does these actions for you. There is no need to use an animation system for these operations and it keeps the project more simple and clean.

All in all it comes to your own preferences, but if you decide to go the non-scripting route, I would definitely recommend using Mecanim. Like you said, because you're just rotating a cube doesn't mean that's everything you need to do in the future. Mecanim is a very powerful animation system and you can't go wrong by learning to use it.

The future is ahead of us and there is no need to use any of the old legacy components.

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
1

Answer by doublemax · Oct 31, 2016 at 12:41 PM

I would recommend iTween. It's a free asset and it's so essential and so simple to use that i actually think it should be integrated into Unity.

https://www.assetstore.unity3d.com/en/#!/content/84

Most simple animations can be achieved with a one-liner.

Comment
Add comment · Show 2 · 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 Neurus_Ex · Oct 31, 2016 at 12:50 PM 0
Share

But my main problem is that, having 3 ways to animate something on Unity, I want to know what's the proper/recommended way to animate something. Adding a fourth way just makes the problem bigger.

avatar image Anton-Korhonen Neurus_Ex · Oct 31, 2016 at 05:45 PM 1
Share

The recommended animation style is what you do by yourself and like to use. Why are there dozens of different types of antialiasing? Because everything comes down to the needs of the project you are developing.

There is no the way of doing animation. I think you saying "adding a fourth way just makes the problem bigger" is wrong kind of thinking. In my optinion it adds variety, flexibility and options. Just because there are dozens of ways of doing something doesn't mean the one you choose is wrong.

Regarding the answer of @doublemax: Tweening is a powerful and fast way of doing animation and assets like iTween and LeanTween are great to start with. Personally i would go with LeanTween because it hass less overhead than other alternatives.

In my project i use a combination of Cinema Director and the built-in $$anonymous$$ecanim.

avatar image
0

Answer by nathanthesnooper · Oct 26, 2016 at 10:02 PM

I try not to use animator for things that don't need an animator or a ton of sprite refs

 public int AnimateFrames;
 
     void Start () {
 
         InvokeRepeating ("AnimateUpdate", 0, 0.125f);
 
     }
 
     void AnimateUpdate () {
 
         AnimateFrames++;
 
         if (AnimateFrames % 4 == 0) {
             this.transform.localPosition = new Vector3 (this.transform.localPosition.x, 1f / 32f, this.transform.localPosition.z);
         }
         if (AnimateFrames % 4 == 2) {
             this.transform.localPosition = new Vector3 (this.transform.localPosition.x, 0, this.transform.localPosition.z);
         }
     }
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 Neurus_Ex · Oct 31, 2016 at 09:58 AM 0
Share

But there's any official recomendation on this topic? I've already done this some times, but I feel like I'm doing something I shouldn't be doing, having all that stuff above to move things.

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

158 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 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 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 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 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 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

root motion on in place animation 0 Answers

I can't setting at once ModelImporter.sourceAvatar in script. 1 Answer

Manipulating an animation towards a target object (ie. The hand and arm lean towards the target) 1 Answer

Mecanim Example Scenes import warnings. 0 Answers

Animation depending on the Int value 0 Answers


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