In this lesson, you will learn how to animate object properties—such as position, rotation, and scale—directly within the Unity Timeline window without needing to create separate .anim files or complex Animator Controllers.
The Power of Animation Tracks
While you have previously used Timeline to orchestrate Cinemachine cameras, you can also use it as a powerful "keyframe sequencer" for any GameObject in your scene. By adding an Animation Track to a Timeline, you create a direct link between the Timeline's playhead and the transform properties of a selected object.
When you click the Record button (the small red circle icon) on the Animation Track, Unity begins tracking your property changes. As you move the playhead along the Timeline and adjust the object in the Scene view, Unity automatically creates keyframes at that specific time.
Why Avoid External Animation Files?
Creating an external animation clip for simple tasks—like a floating platform moving between two points or a door oscillating open—often creates unnecessary clutter in your Project folder. By animating directly in the Timeline, you keep the logic localized to the cutscene or event sequence.
For example, if you want a light to flicker during a cinematic, you simply:
- Add an
Animation Trackto your Timeline. - Drag your light GameObject into the track.
- Click the
Recordbutton. - Scrub the playhead to different time intervals and adjust the light’s
Intensityin the Inspector.
Timeline will generate an animation clip embedded directly within the Timeline asset, which you can trim, loop, or blend just like a camera shot.
// No C# code is needed to define this movement!
// 1. Create Timeline Asset.
// 2. Add Animation Track -> Bind GameObject.
// 3. Toggle Record mode.
// 4. Transform.position changes are now captured as track keyframes.
This method is perfect for environmental storytelling where you need precise, non-looping motion that is explicitly tied to the duration of your Timeline sequence.
Key Takeaway: Animating objects directly in Timeline allows you to craft precise, sequence-specific motion by recording property changes in-place, eliminating the need for external animation clips and complex state management.