[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:00.25,0:00:02.44,Default,,0000,0000,0000,,The animation view allows you to create and Dialogue: 0,0:00:02.44,0:00:06.04,Default,,0000,0000,0000,,modify animation clips directly inside Unity. Dialogue: 0,0:00:06.60,0:00:08.60,Default,,0000,0000,0000,,It is designed to act as a powerful Dialogue: 0,0:00:08.60,0:00:10.60,Default,,0000,0000,0000,,and straightforward alternative to external Dialogue: 0,0:00:10.60,0:00:12.60,Default,,0000,0000,0000,,3D animation programmes. Dialogue: 0,0:00:13.77,0:00:15.77,Default,,0000,0000,0000,,For instance, if we wanted to have Dialogue: 0,0:00:15.77,0:00:17.77,Default,,0000,0000,0000,,a camera fly around a scene to give Dialogue: 0,0:00:17.77,0:00:20.19,Default,,0000,0000,0000,,a player an overview of a level Dialogue: 0,0:00:20.19,0:00:23.31,Default,,0000,0000,0000,,we can create that animation for it in Unity. Dialogue: 0,0:00:24.79,0:00:26.79,Default,,0000,0000,0000,,Here we have a scene with a camera Dialogue: 0,0:00:26.79,0:00:28.04,Default,,0000,0000,0000,,in the corner. Dialogue: 0,0:00:29.02,0:00:31.02,Default,,0000,0000,0000,,We would like to create an animation Dialogue: 0,0:00:31.02,0:00:33.51,Default,,0000,0000,0000,,for that camera which will allow it to move Dialogue: 0,0:00:33.51,0:00:36.13,Default,,0000,0000,0000,,from one side of the scene to the other. Dialogue: 0,0:00:36.96,0:00:38.96,Default,,0000,0000,0000,,Since we want to make an animation for the Dialogue: 0,0:00:38.96,0:00:40.96,Default,,0000,0000,0000,,camera we will want to ensure Dialogue: 0,0:00:40.96,0:00:43.99,Default,,0000,0000,0000,,that it is selected in the Hierarchy view. Dialogue: 0,0:00:44.65,0:00:46.96,Default,,0000,0000,0000,,We can then open the Animation view Dialogue: 0,0:00:46.96,0:00:49.36,Default,,0000,0000,0000,,by clicking Window - Animation. Dialogue: 0,0:00:50.48,0:00:53.02,Default,,0000,0000,0000,,Like any other view this is moveable Dialogue: 0,0:00:53.02,0:00:55.02,Default,,0000,0000,0000,,resizable and dockable. Dialogue: 0,0:00:55.80,0:00:57.80,Default,,0000,0000,0000,,There are many different buttons and options Dialogue: 0,0:00:57.80,0:01:00.72,Default,,0000,0000,0000,,visible when you first open the Animation view. Dialogue: 0,0:01:01.36,0:01:04.86,Default,,0000,0000,0000,,First and foremost is the animation drop-down. Dialogue: 0,0:01:04.86,0:01:06.57,Default,,0000,0000,0000,,Here is where we can select our different Dialogue: 0,0:01:06.57,0:01:08.25,Default,,0000,0000,0000,,animations to edit. Dialogue: 0,0:01:08.91,0:01:11.40,Default,,0000,0000,0000,,Since we don't currently have any animations Dialogue: 0,0:01:11.40,0:01:13.40,Default,,0000,0000,0000,,this drop-down is blank except for the Dialogue: 0,0:01:13.40,0:01:15.97,Default,,0000,0000,0000,,ability to create a new animation. Dialogue: 0,0:01:17.91,0:01:19.91,Default,,0000,0000,0000,,When you create a new animation you will Dialogue: 0,0:01:19.91,0:01:22.45,Default,,0000,0000,0000,,be prompted for a name and a location Dialogue: 0,0:01:22.45,0:01:24.45,Default,,0000,0000,0000,,to save the animation file. Dialogue: 0,0:01:25.14,0:01:27.14,Default,,0000,0000,0000,,We will create an animation called Dialogue: 0,0:01:27.14,0:01:29.14,Default,,0000,0000,0000,,CameraFlyThu and place it Dialogue: 0,0:01:29.14,0:01:31.14,Default,,0000,0000,0000,,in the Animations folder. Dialogue: 0,0:01:32.50,0:01:34.43,Default,,0000,0000,0000,,The Add Curve button allows us to choose Dialogue: 0,0:01:34.43,0:01:36.15,Default,,0000,0000,0000,,which components of our object, Dialogue: 0,0:01:36.15,0:01:38.15,Default,,0000,0000,0000,,or any child objects, we wish to modify Dialogue: 0,0:01:38.15,0:01:40.15,Default,,0000,0000,0000,,with our animation. Dialogue: 0,0:01:41.09,0:01:43.02,Default,,0000,0000,0000,,Each component can be expanded Dialogue: 0,0:01:43.02,0:01:45.02,Default,,0000,0000,0000,,to view more options. Dialogue: 0,0:01:45.52,0:01:47.98,Default,,0000,0000,0000,,To add a curve click the + sign next Dialogue: 0,0:01:47.98,0:01:49.69,Default,,0000,0000,0000,,to the item you wish to add. Dialogue: 0,0:01:50.19,0:01:52.75,Default,,0000,0000,0000,,Since we want our camera to fly around the scene Dialogue: 0,0:01:52.75,0:01:56.85,Default,,0000,0000,0000,,we will add the transform's position and rotation. Dialogue: 0,0:01:57.97,0:01:59.97,Default,,0000,0000,0000,,The timeline is where you will be able to Dialogue: 0,0:01:59.97,0:02:02.79,Default,,0000,0000,0000,,establish the timing of your animation. Dialogue: 0,0:02:02.79,0:02:05.41,Default,,0000,0000,0000,,The timeline is measured in frames and seconds. Dialogue: 0,0:02:06.00,0:02:08.15,Default,,0000,0000,0000,,The red scrubber allows you to choose what Dialogue: 0,0:02:08.15,0:02:10.15,Default,,0000,0000,0000,,frame you wish to modify. Dialogue: 0,0:02:12.17,0:02:14.70,Default,,0000,0000,0000,,Next is the Record and Play buttons. Dialogue: 0,0:02:15.08,0:02:16.92,Default,,0000,0000,0000,,When the record button is pressed Dialogue: 0,0:02:16.92,0:02:18.53,Default,,0000,0000,0000,,changes made to the chosen object Dialogue: 0,0:02:18.53,0:02:21.34,Default,,0000,0000,0000,,in the Scene view will be added automatically Dialogue: 0,0:02:21.34,0:02:24.34,Default,,0000,0000,0000,,to the animation at the currently selected frame. Dialogue: 0,0:02:25.71,0:02:27.95,Default,,0000,0000,0000,,The play button will allow you to preview Dialogue: 0,0:02:27.95,0:02:29.25,Default,,0000,0000,0000,,your animation. Dialogue: 0,0:02:30.67,0:02:32.41,Default,,0000,0000,0000,,The left and right arrows allow you to Dialogue: 0,0:02:32.41,0:02:34.93,Default,,0000,0000,0000,,navigate through the keyframes of the animation. Dialogue: 0,0:02:35.70,0:02:37.85,Default,,0000,0000,0000,,Next are the buttons which allow you to Dialogue: 0,0:02:37.85,0:02:39.85,Default,,0000,0000,0000,,add keyframes and events to the Dialogue: 0,0:02:39.85,0:02:41.85,Default,,0000,0000,0000,,currently selected frame. Dialogue: 0,0:02:42.43,0:02:44.43,Default,,0000,0000,0000,,The Sample property determines how many Dialogue: 0,0:02:44.43,0:02:46.75,Default,,0000,0000,0000,,frames make up one second of animation. Dialogue: 0,0:02:47.19,0:02:50.62,Default,,0000,0000,0000,,Reducing this number makes our animations slower. Dialogue: 0,0:02:52.06,0:02:54.06,Default,,0000,0000,0000,,At the bottom are two buttons that allow Dialogue: 0,0:02:54.06,0:02:56.78,Default,,0000,0000,0000,,you to transition between dope sheet mode, Dialogue: 0,0:02:56.78,0:02:58.45,Default,,0000,0000,0000,,which we are currently on, Dialogue: 0,0:02:58.45,0:03:00.45,Default,,0000,0000,0000,,and curve view mode. Dialogue: 0,0:03:01.54,0:03:03.54,Default,,0000,0000,0000,,With the record button pressed Dialogue: 0,0:03:03.54,0:03:05.80,Default,,0000,0000,0000,,it can be very easy to rough out the animation Dialogue: 0,0:03:05.80,0:03:07.08,Default,,0000,0000,0000,,that we want. Dialogue: 0,0:03:07.70,0:03:10.31,Default,,0000,0000,0000,,Simply select the frame we want to modify Dialogue: 0,0:03:12.31,0:03:14.80,Default,,0000,0000,0000,,and rotation in the scene view. Dialogue: 0,0:03:10.31,0:03:12.31,Default,,0000,0000,0000,,and then set the desired camera position Dialogue: 0,0:03:15.31,0:03:17.54,Default,,0000,0000,0000,,You will notice that a keyframe has been added Dialogue: 0,0:03:17.54,0:03:20.15,Default,,0000,0000,0000,,to the timeline with the appropriate values. Dialogue: 0,0:03:20.88,0:03:22.88,Default,,0000,0000,0000,,Properties that are currently being animated Dialogue: 0,0:03:22.88,0:03:25.59,Default,,0000,0000,0000,,are highlighted in red in the Inspector. Dialogue: 0,0:03:27.05,0:03:29.94,Default,,0000,0000,0000,,We can continue doing this for the various phases Dialogue: 0,0:03:29.94,0:03:31.94,Default,,0000,0000,0000,,of our fly through animation. Dialogue: 0,0:03:33.32,0:03:35.46,Default,,0000,0000,0000,,To preview the animation click the Dialogue: 0,0:03:35.46,0:03:38.12,Default,,0000,0000,0000,,play icon next to the record icon Dialogue: 0,0:03:38.12,0:03:40.12,Default,,0000,0000,0000,,in the animator view. Dialogue: 0,0:03:41.78,0:03:44.38,Default,,0000,0000,0000,,If we were satisfied with our animation Dialogue: 0,0:03:44.38,0:03:46.38,Default,,0000,0000,0000,,we could be done now. Dialogue: 0,0:03:46.38,0:03:49.30,Default,,0000,0000,0000,,If we wanted to fine tune our animation however Dialogue: 0,0:03:49.30,0:03:51.72,Default,,0000,0000,0000,,we would want to look at the curves mode. Dialogue: 0,0:03:52.25,0:03:55.36,Default,,0000,0000,0000,,To enter the curves mode select the Curves button Dialogue: 0,0:03:55.36,0:03:58.08,Default,,0000,0000,0000,,at the bottom of the animation view. Dialogue: 0,0:03:59.01,0:04:01.01,Default,,0000,0000,0000,,Here we can see the various curves of our Dialogue: 0,0:04:01.01,0:04:03.50,Default,,0000,0000,0000,,animation by selecting the corresponding Dialogue: 0,0:04:03.50,0:04:05.68,Default,,0000,0000,0000,,component on the left. Dialogue: 0,0:04:05.68,0:04:08.77,Default,,0000,0000,0000,,Again we can select a frame using the red Dialogue: 0,0:04:08.77,0:04:10.77,Default,,0000,0000,0000,,red scrubber on the timeline. Dialogue: 0,0:04:13.51,0:04:15.60,Default,,0000,0000,0000,,To modify a value on a curve Dialogue: 0,0:04:15.60,0:04:17.60,Default,,0000,0000,0000,,click and drag a keyframe to the new Dialogue: 0,0:04:17.60,0:04:19.48,Default,,0000,0000,0000,,desired value. Dialogue: 0,0:04:19.48,0:04:21.85,Default,,0000,0000,0000,,To create a new keyframe click the Dialogue: 0,0:04:21.85,0:04:23.74,Default,,0000,0000,0000,,Create Keyframe button, Dialogue: 0,0:04:23.74,0:04:25.74,Default,,0000,0000,0000,,or double click on the curve. Dialogue: 0,0:04:26.97,0:04:28.78,Default,,0000,0000,0000,,Right-clicking on a keyframe will pull up Dialogue: 0,0:04:28.78,0:04:30.70,Default,,0000,0000,0000,,some of it's options. Dialogue: 0,0:04:30.70,0:04:32.70,Default,,0000,0000,0000,,the most notable of these options is the ability Dialogue: 0,0:04:32.70,0:04:34.70,Default,,0000,0000,0000,,to choose Free Smooth. Dialogue: 0,0:04:35.28,0:04:37.83,Default,,0000,0000,0000,,This will create two handles are the keyframe Dialogue: 0,0:04:37.83,0:04:39.83,Default,,0000,0000,0000,,which you can use to smooth the curve Dialogue: 0,0:04:39.83,0:04:41.83,Default,,0000,0000,0000,,to your liking. Dialogue: 0,0:04:42.79,0:04:44.79,Default,,0000,0000,0000,,Another way to control our curves is to Dialogue: 0,0:04:44.79,0:04:46.79,Default,,0000,0000,0000,,choose the Broken option. Dialogue: 0,0:04:47.95,0:04:49.69,Default,,0000,0000,0000,,This allows you to control each side of the Dialogue: 0,0:04:49.69,0:04:51.69,Default,,0000,0000,0000,,keyframe indecently. Dialogue: 0,0:04:52.96,0:04:55.40,Default,,0000,0000,0000,,In this example we will want to add Dialogue: 0,0:04:55.40,0:04:56.99,Default,,0000,0000,0000,,a little variance to the exposition Dialogue: 0,0:04:56.99,0:04:58.79,Default,,0000,0000,0000,,of the transform. Dialogue: 0,0:04:58.79,0:05:01.20,Default,,0000,0000,0000,,Doing so will give us more of a weightless feel Dialogue: 0,0:05:01.20,0:05:03.20,Default,,0000,0000,0000,,to our animation. Dialogue: 0,0:05:04.49,0:05:07.32,Default,,0000,0000,0000,,Again we can do so by creating keyframes Dialogue: 0,0:05:07.32,0:05:09.32,Default,,0000,0000,0000,,on the exposition curve and changing Dialogue: 0,0:05:09.32,0:05:11.32,Default,,0000,0000,0000,,our values manually. Dialogue: 0,0:05:13.36,0:05:16.19,Default,,0000,0000,0000,,The animations created in Unity have the same Dialogue: 0,0:05:16.19,0:05:18.56,Default,,0000,0000,0000,,Inspector settings as animations made Dialogue: 0,0:05:18.56,0:05:20.24,Default,,0000,0000,0000,,in external programmes. Dialogue: 0,0:05:20.65,0:05:22.40,Default,,0000,0000,0000,,We can see these by selecting our clip Dialogue: 0,0:05:22.40,0:05:24.64,Default,,0000,0000,0000,,in the Project view. Dialogue: 0,0:05:24.64,0:05:26.32,Default,,0000,0000,0000,,Since we want our camera to fly across the Dialogue: 0,0:05:26.32,0:05:29.28,Default,,0000,0000,0000,,screen only once, we best uncheck Dialogue: 0,0:05:29.28,0:05:31.28,Default,,0000,0000,0000,,are Loop Time property. Dialogue: 0,0:05:32.44,0:05:34.83,Default,,0000,0000,0000,,It is interesting to note that an animator Dialogue: 0,0:05:34.83,0:05:36.83,Default,,0000,0000,0000,,is in charge of animation playback for generic Dialogue: 0,0:05:36.83,0:05:39.46,Default,,0000,0000,0000,,objects the same as it is for humanoids. Dialogue: 0,0:05:40.18,0:05:42.18,Default,,0000,0000,0000,,Unity has automatically added the Dialogue: 0,0:05:42.18,0:05:44.54,Default,,0000,0000,0000,,animator to our camera and created an Dialogue: 0,0:05:44.54,0:05:47.11,Default,,0000,0000,0000,,animator controller, a state machine Dialogue: 0,0:05:47.11,0:05:49.11,Default,,0000,0000,0000,,and added it to this component Dialogue: 0,0:05:50.00,0:05:52.48,Default,,0000,0000,0000,,The clip we just created is added to the Dialogue: 0,0:05:52.48,0:05:54.48,Default,,0000,0000,0000,,state machine as the default clip Dialogue: 0,0:05:54.48,0:05:56.48,Default,,0000,0000,0000,,that would be played at runtime. Dialogue: 0,0:05:57.70,0:05:59.70,Default,,0000,0000,0000,,This means we can go on to record Dialogue: 0,0:05:59.70,0:06:01.70,Default,,0000,0000,0000,,other clips and use the animator Dialogue: 0,0:06:01.70,0:06:03.70,Default,,0000,0000,0000,,to decide when to play them. Dialogue: 0,0:06:04.20,0:06:06.47,Default,,0000,0000,0000,,In this manner, once our animation clip Dialogue: 0,0:06:06.47,0:06:08.95,Default,,0000,0000,0000,,is completed we can run our scene Dialogue: 0,0:06:08.95,0:06:10.95,Default,,0000,0000,0000,,to see it in action.