How to do it...

To use the Animation View and create a flickering light, follow these steps:

  1. Open the scene and select a light you want to animate.
  2. With the light selected, go to Window | Animation. The Animation View will open.
  3. To create a new animation, click on the Create button, as shown in the following screenshot:
  1. Create New Animation Clip will appear. You can choose a directory and the animation name. Then, click the Save button.
  2. A new, empty animation will be created, an Animator component will be added to the selected game object (a light in this example), and an Animator Controller will be created in the same directory as the animation clip.
  3. To animate the light intensity, we need to add an Intensity property. Click on the Add Property button in the Animation View, then choose Light | Intensity, and then click on the + icon next to it, as shown in the following screenshot:
  1. Two key frames will be added. You can click and drag on them to adjust their position in time. You can also add new key frames by changing any property in the light game object's Inspector (make sure to have the record button clicked in the upper-left corner of the Animation View).
  2. Add several key frames with different values of light intensity.
  3. Close the Animation View when the animation is done. Any changes will be saved automatically.
  4. Play the game to see the effect.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.80.209