Panning Security Cameras in Unity
Objective: Animation security cameras to sweep back and forth across an area.

First we’ll create an animation clip rotating the the camera’s y-rotation. In this case, we’re going from 45° to -45°.

Then, in the Animator Controller, we’ll duplicate the clip and set its Speed to -1. This effectively reverses our clip, going from -45° to 45°.

Then, for each of the transitions, we’ll select Has Exit Time and set the Exit Time to the length of our clip (in this case 1 second) so the entire clip will play before exiting to the next clip. We’ll also make sure there is no Transition Duration or Transition Offset. These settings will create the even panning back and forth movement that we desire!
