Lesson 44 +10 XP

Animation Clips & Keyframes

Animation Clips & Keyframes

Unity's animation system allows you to animate almost any property of a GameObject (position, scale, color, light intensity) over time.

Animation Clips

An Animation Clip is an asset containing information about how properties change over a timeline.

To create an Animation Clip:

  1. Select a GameObject.
  2. Open the Animation Window (Window -> Animation -> Animation).
  3. Click Create to save a new clip asset.

Keyframes

Animations are built on Keyframes:

  • You set a property value at a specific time (a keyframe).
  • Unity automatically interpolates (smoothly calculates) values between keyframes.

Click the Record button (red circle) in the Animation Window, select a time on the timeline, and modify your GameObject in the Scene or Inspector to add keyframes automatically.

Dopesheet vs Curves

  • Dopesheet View: Displays keyframes as simple diamond points on a horizontal timeline (useful for checking timing).
  • Curves View: Displays keyframes as points on a graph spline. You can adjust the handles of these splines to change easing speed (e.g. starting slow and ending fast).

TL;DR

  • Animation Clips store how properties change over time.
  • Open the Animation window to create clips.
  • Keyframes mark specific values at points in time; Unity fills in the rest.
  • Dopesheet view manages timing; Curves view manages transition easing.