Reader small image

You're reading from  Unity 5.x Animation Cookbook

Product typeBook
Published inMay 2016
Reading LevelExpert
PublisherPackt
ISBN-139781785883910
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Maciej Szczesnik
Maciej Szczesnik
author image
Maciej Szczesnik

Not interested. Too busy with current game project. Source: Linkedin.
Read more about Maciej Szczesnik

Right arrow

Creating camera shakes with the Animation View and the Animator Controller


In this recipe, we will use a simple, but very effective method for creating camera shakes. Those effects are often used to emphasize impacts or explosions in our games.

 

Getting ready

You don't need anything special for this recipe. We will create everything from scratch in Unity. You can also download the provided example Unity project and go to the Chapter 07 Special effects\Recipe 02 Creating camera shakes with the animation window and the animator controller directory. When you open the  Example.unity scene and play the game, you can press the space bar to see a simple camera shake effect.

How to do it...

To create a camera shake effect, follow these steps:

  1. Create an empty game object in the Scene View and name it CameraRig.
  2. Parent the Main Camera to the CameraRig.
  3. Select the Main Camera and add an Animator component to it.
  4. Open the Animation View.
  5. Create a new Animation Clip and call it CamNormal. The camera should have...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Unity 5.x Animation Cookbook
Published in: May 2016Publisher: PacktISBN-13: 9781785883910

Author (1)

author image
Maciej Szczesnik

Not interested. Too busy with current game project. Source: Linkedin.
Read more about Maciej Szczesnik