Animations in Unity

Animations are essential to any Unity project, bringing characters and objects to life with fluid movement and dynamic actions. With Unity’s powerful animation tools, game developers can create engaging experiences that captivate players and enhance the game experience. In this lesson, we’ll explore the different types of animations available in Unity, categorizing them into two main groups: in-editor and external. By understanding these classifications, developers can better integrate animations into their projects and create more immersive and engaging experiences for their players.

Unity in-editor animation

These are the types of animations that can be created in Unity. Let’s learn about them with the help of an example of a bouncing ball.

Ball bounce animation

In this section, we’re going to add animation to a Sphere GameObject.

Step 1: Add a Sphere GameObject

  • First, import a Sphere GameObject in the scene. For this, navigate to “GameObject > 3D Object > Sphere.”

  • For aesthetics, add any color to the sphere.

Step 2: Open the Animation window

  • Navigate to “Window > Animation > Animation” and a new window will open up. Place the “Animation” window beside the “Scene” window. Initially, the “Animation” window will be empty because we’ve not added any animation yet.

Step 3: Create the Animator and Animation Clip

  • Open the “Animation” window and then select “Sphere” in the “Hierarchy” window.

  • Now, a “Create” button will appear in the window having the following text: “To begin animating Sphere, create an Animator and an Animation Clip.” The “Create” button will automatically create these. Click the “Create” button, create a folder named “Animations,” and save the animation with the name “bouncy_ball.” It will be saved as “bouncy_ball.anim.”

  • As you can observe from the “Inspector” window, an “Animator” component gets attached to the sphere.

Note: If you encounter issues such as the “Create” button not being visible by default in the “Animation” window, try maximizing the “Animation” window to ensure all elements are accessible.

Get hands-on with 1400+ tech skills courses.