Learn to make cutscenes in unity3d by building a stealth Game.
Objective: Challenge Animate Security Cameras.
In the First step go window <Animation and place the tab at the bottom of the game view.
Select the SecurityCameras<Camera<Camera_1, and create an animation clip on it.
In the following step create the animator component and drag and drop the controller in the animator on the controller option on the inspector. Then Select the animation clip and disable loop time.
Note: Most of the time this step is done automatically when creating an animation clip but sometimes this step is skipped by unity.
Now hit the record button and manipulate y rotation as 45 in the first frame and move the slider to one second and manipulate y rotation as -45.
Double click the camera 1 controller, then duplicate the Security clip and rename the second clip as security cam reverse then make the transition from the first clip and create another from the second to the first. Select the second clip to change the speed value from 1 to -1, this will make the security camera move from the last frame to the first when the transition comes to the second clip.
Note: When creating an animation clip and renaming the clip as the name of the parent game object you may experience weird behavior sometimes animator may be placed at the parent game object and that's why I didn't see the animator created for camera 1. If I play I won't get the result.
To solve this select the parent object with the same name as the animation clip name and remove the animator component on it.
When we play we notice the camera rotates so fast, to fix this go to the frame tab and right-click three dots and select the show frame sample. Or right-click three dots then Set a simple rate and choose the value.
Last I want to add all these set up to the second Security on the second pillar so I won't repeat all these steps, again and again, we do this by selecting the second camera1 adding the animator component on it, then drag and drop the camera1 controller on this controller option.
This is how I solve this challenge.