Animation Clip
- Game Development course
- Intermediate
- Lesson 20/83
- 4 min
Learn to create a new Animation Clip and add keyframes.
Creating an Animation Clip
An Animation Clip stores the properties of an object that change over time. In Unity, open the Animation window through Window > Animation > Animation. You can create and save a new animation clip using the Create option.
// Animation Clip
// Position
// Rotation
// ScaleAdding Keyframes and Editing Curves
In the Animation window, you can move to a specific point on the timeline and add a keyframe to a property. For example, you can record an object's starting position at the first frame and its target position at a later frame. The Curve view helps you control how values change between keyframes.
// First keyframe: X = 0
// Second keyframe: X = 4Practice Create an AnimationCurve
Create an AnimationCurve and define its starting and ending values using the EaseInOut method. Then evaluate the curve at 0.5 seconds and print the result to the console.
Starter code
using UnityEngine;
public class CurveExample : MonoBehaviour
{
void Start()
{
}
}Sample solution
using UnityEngine;
public class CurveExample : MonoBehaviour
{
void Start()
{
AnimationCurve curve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
float value = curve.Evaluate(0.5f);
Debug.Log("Eğri değeri: " + value);
}
}Expected output
Eğri değeri: 0.5
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Which option is used to create a new clip in the Animation window?
- Bake
- Import
- Revert
- Create Correct answer
Explanation: The Create option allows you to create a new Animation Clip.
2 The Clip Creation Option
Yeni bir Animation Clip oluşturmak için Animation penceresindeki ____ seçeneğini kullanırsın.
Yeni bir Animation Clip oluşturmak için Animation penceresindeki Create seçeneğini kullanırsın.
Explanation: The Create option creates a new animation clip.
3 Match Animation Clip Tools
| Term | Meaning |
|---|---|
Animation Window |
Window used to edit animation clips |
Create |
Option to create a new animation clip |
Keyframe |
Property value at a specific time |
Curve View |
Editing changes between keyframes |