Confused about animations

I’ve tried searching around and I find some answers which never seem to explain this to me fully. Some are simply outdated and others don’t explain what’s happening.

What I want to know is what are my options when making animations?

  • Can I make animations directly in unity (using the “Animations” component)?
  • When making animations in 3d software (I use Blender), how would I go about animating and scripting (C#) different weapons and such?

How does the animation scripting go? I’ve seen some examples that are simply animation.Play(), which doesn’t seem to do anything and doesn’t really make sense to me and others which have got to do with the “Animator” component. I’m using C#, if that wasn’t clear by now.

A little insight into what I’m doing right now:
I’m doing a little test project, I’ve scripted a first person Rigidbody controller and made a simple axe using the in-engine shapes. What I’m looking for is animating the axe to do a chopping animation when I hit left click. I also want to set it up so I can switch between weapons and/or tools and have an animation on the rest of them as well.

Complicated answers are fine as this project is aimed at improving my skills and knowledge with unity and C#, all I want to ask is for a detailed answer or documentation which explains the process used.

First of all: You can make animations directly in Unity with the Animations window. It’s sufficient for things like moving doors or platforms, but if you’re trying to animate a character, you’ll need to get an actual animation program rather than trying to use that. It’s simply too simplistic to get something like a decent walking animation done without a ton of extra work.

Unity used to base animations on the Animation component. Development was stopped on that in favor of the animator component. There have been several discussions (read: tons of flame wars) over if that was a good idea or not. Unity internally considers it to be deprecated. That does not count for the Animation window - just the component. Yes, this is confusing.

The old Animation component was simply a list of animation clips. You sent it the name of the clip it should play from your script, and that was it.

The Animator, on the other hand, is a wrapper around a state machine setup. You create the state machine (an Animator Controller), use the Animator window to mess with it, and an Animator component to use it. You transition between states from scripts by sending trigger messages and setting variables on your animator.

You should read through this part of the docs, as it goes into depth on all of the components and how they work.