Using the Animation View to create a flickering light
This first recipe shows how to make a basic animation inside Unity. We will animate a light-intensity value to create an interesting flickering light effect, which is often found in horror or sci-fi games.
Getting ready
Before we start, you need to have a scene with geometry and at least one light. You can also download the example provided; open the project in Unity and go to the folder Chapter 02 Working with the animation view\Recipe 01 Using the animation view to create a flickering light
. You will find a scene called Example.unity
there, with a point light that has already been animated.
How to do it...
To use the Animation View and create a flickering light, follow these steps:
- Open the scene and select a light you want to animate.
- With the light selected, go to
Window
|Animation
. The Animation View will open. - To create a new animation, click on the
Create
button, as shown in the following screenshot:
- A
Create New Animation Clip
will appear...