More animations with Timeline

It’s not only the position and rotation of objects that can be animated in Unity. Just about anything that can be adjusted, can be animated, such as colours, transparency or UI elements. Let’s go over some of these animations with Timeline:

01. Transparency
A very common type of animation is the transparency of a black image, which covers the whole screen. This is used to simulate a fade in or fade out.

First, add a UI image to the scene and set it to cover the whole screen (hold down the alt key to enable stretching):

Change the colour to black:

Add a Timeline object as shown in previous articles. Drag in the UI Image and set as an Animation Track:

Now all you need to do is to record two frames. One with max alpha and another with no alpha:

02. Colour and Size

As previously, drag the object you want to animate onto the Timeline and add Animation Track:

Create and add a new material to the object:

Start recording the object on the Timeline, set the colour for the first frame and then set colour for the next frame:

In my opinion the easiest way to scale in all directions at the same time is to use the Scaling tool:

In order to prevent the object from scaling into the ground, you can animate the object to move upwards at the same time:

03. UI

When you add an object to the Timeline with children the child objects are then seen as part of that object. This makes it possible to be more organised for example if you want to animate a whole menu with several parts on the same track.

First, add the parts that will make up the menu, for example two buttons and a text object:

Drag the parent onto the Timeline and select Animation track:

For this article I decided to have all the elements move in from outside of the screen.

The position of the UI objects can be animated the same way as any other objects with a transform:

If you are happy with the flow of the new animation but you want it to start later in the Timeline, then you can convert the track to a clip and then move it to the position you want:

Good luck!

Unity / C# Game developer