In this blog, we will learn to create animations in Unity. Unity features a powerful and intuitive animation engine that allows you to animate whatever you want. However, some animations, particularly the simplest ones, do not require the entire capacity of the animation engine.
Unity performs the following actions when you save this new empty Animation Clip:
This function generates a new Animator Controller Asset.
Adds the new clip as the default state to the Animator Controller.
Adds an Animator Component to the GameObject to which animation is being applied.
The new Animator Controller is assigned to the Animator Component.
The animation system's required elements are now in place, and you can begin animating the GameObject.
Now, let’s learn how to add another animation clip using Unity.
Adding another Animation Clip
If the GameObject already has one or more than one animation clips assigned, the "Create" button is hidden. One of the existing clips will be visible in the Animation window instead of the "Create" button. To switch between Animation Clips, we will use the menu in the top-left corner of the Animation window, next to the playback controls.
Select Create New Clip from this menu to add a new Animation Clip to an existing GameObject. Again, Unity prompts us to save our new empty Animation Clip before you can work on it.
After we create a new Animation Clip, we can now see:
The Animation Window (top left) displays a timeline with a white playback headline, ready for new keyframes to be recorded. The clip's name appears in the clip menu, just below the playback controls.
The Inspector (center) reveals that the "Cube" GameObject has an Animator Component. The Controller field of the component reveals that it is assigned to an Animator Controller Asset called Cube.
The Project Window (bottom right) displays two new Assets: an Animation Clip Asset called Cube Animation Clip and an Animator Controller asset called Cube.
The Animator Window (bottom left) displays the Animator Controller's contents: The controller has a Cube Animation Clip in the default state. Subsequent clips added to the controller are grey, indicating that they are not in the default state.
Now, we will move to the Faqs section to clear our doubts regarding creating animations.
Frequently Asked Questions
What is an animator in Unity?
An Animator Controller allows us to arrange and maintain a set of Animation Clips and associated Animation Transitions. Transitions define how long a blend between states should take and the conditions that activate them.
What is an Animator's job?
An animator's job is to create a series of images called frames. When frames are combined, they create the appearance of the movement known as animation. They use digital or hand-drawn graphics, models, or puppets to create the images. Animators specialize in 2D, 3D modeling, stop-frame animation, and computer-generated animation.
How do we run animations in Unity?
First, we need to choose our animation clips. After choosing the animator clip, we need to create an Animation Controller. To animate a player or game object, attach this controller to it. In the end, select an animator from the Windows menu. Two states will be formed if you drag the two animation clips to the Animator window.
What is the difference between animators in Unity and animation?
Animations are older versions of Animators. Animators were introduced in version 3.0 to help overcome some of the animation's shortcomings. Animations only change the visual representation of the object. Animations are recommended to use when we are just changing the opacity. But it causes problems when we want to rotate, translate or scale objects.
What software do animators use?
Autodesk Maya is the software for many animation studios and professional animators. Character development, simulation, modeling, motion graphics, and more are all possible with this 3D animation software.
Conclusion
In this article, we have extensively discussed creating animations in Unity. This article outlines how to create new animations and add another animation. And at the end of the blog, we have seen some faqs to understand Animation creation in Unity better.