WEBVTT 1 00:00:05.675 --> 00:00:09.825 Game Advanced Beta type Version 3 2 00:00:27.475 --> 00:00:32.225 Hello everyone, this is Park Hyun-sang, in charge of FPS game creation lectures 3 00:00:32.225 --> 00:00:34.725 In this lesson, I will be giving a lecture on 4 00:00:34.725 --> 00:00:38.275 Cinemachine and sequence control 5 00:00:38.725 --> 00:00:42.325 Using features like sequences and Cinemachine, 6 00:00:42.325 --> 00:00:45.825 you can easily create elements that would be 7 00:00:45.825 --> 00:00:48.175 complex to implement through programming 8 00:00:48.675 --> 00:00:53.125 By creating these cutscenes, 9 00:00:53.125 --> 00:00:54.875 you can guide users to become more immersed 10 00:00:54.875 --> 00:00:58.825 in the main flow of opening or ending content 11 00:00:58.825 --> 00:01:02.875 Cutscene creation using Cinemachine and Sequences 12 00:01:02.875 --> 00:01:06.525 The topic of this session is a lecture on cutscene creation 13 00:01:06.525 --> 00:01:10.575 or Cinemachine creation using Cinemachine 14 00:01:10.575 --> 00:01:14.575 First, we will define what a cutscene is and then move on from there 15 00:01:15.375 --> 00:01:17.575 A cutscene is generally a screen 16 00:01:17.575 --> 00:01:21.325 used to show important story elements, such as in the opening or ending 17 00:01:21.325 --> 00:01:24.375 where the user does not control the action 18 00:01:24.375 --> 00:01:26.325 It is created and directed by the developers 19 00:01:26.325 --> 00:01:29.075 to be shown to the users 20 00:01:29.075 --> 00:01:33.975 It is primarily used for story delivery or to provide hints 21 00:01:33.975 --> 00:01:37.075 and other explanations to the users 22 00:01:37.075 --> 00:01:38.975 through direction 23 00:01:38.975 --> 00:01:42.525 In the past, games like the Final Fantasy series 24 00:01:42.525 --> 00:01:47.975 used actual cutscene videos to show scenes, while during gameplay, 25 00:01:47.975 --> 00:01:52.625 they used slightly lower-quality models 26 00:01:52.625 --> 00:01:55.875 to display real time play 27 00:01:55.875 --> 00:02:00.975 On the other hand, recently, there are many more cases 28 00:02:00.975 --> 00:02:04.825 where the quality of in-game data, 29 00:02:04.825 --> 00:02:09.625 which refers to playable data, is improved and directly used for cutscenes 30 00:02:09.625 --> 00:02:12.675 I will explain the cutscene usage case of 31 00:02:12.675 --> 00:02:16.325 the recently popular content Ogong 32 00:02:16.325 --> 00:02:19.425 and then move on to the practical exercises 33 00:02:20.025 --> 00:02:25.775 The screen you see now is the actual gameplay screen that I am playing 34 00:02:25.775 --> 00:02:31.325 Since we are running it for the first time, the menu button is displayed 35 00:02:32.425 --> 00:02:37.074 When you play it, clicking on New Game 36 00:02:37.074 --> 00:02:41.274 takes you directly to the character movement screen, 37 00:02:43.674 --> 00:02:47.174 and the predetermined opening sequence begins 38 00:02:48.824 --> 00:02:51.924 I would love to show you everything, but 39 00:02:51.924 --> 00:02:54.674 Since it's quite long, about 5 minutes, it would take too much time 40 00:02:54.674 --> 00:02:57.924 I'll move on to the next stage of gameplay right away 41 00:03:00.824 --> 00:03:06.274 After these predetermined scenes play out, 42 00:03:08.724 --> 00:03:11.974 around the 12-minute mark, 43 00:03:11.974 --> 00:03:14.974 you'll start seeing footage of me playing the game myself 44 00:03:14.974 --> 00:03:19.874 Since it's the first time, I'm slowly testing the movement back and forth 45 00:03:22.174 --> 00:03:25.624 This is what the situation looks like just before the game starts 46 00:03:25.624 --> 00:03:31.774 In the predetermined cutscene, the protagonist delivers lines, 47 00:03:31.774 --> 00:03:38.124 the enemy appears, and then the gameplay seamlessly continues 48 00:03:38.124 --> 00:03:42.424 As the gameplay progresses, 49 00:03:45.774 --> 00:03:48.274 you eventually defeat the boss 50 00:03:51.174 --> 00:03:53.124 After the boss is defeated, 51 00:03:53.124 --> 00:03:59.524 another predetermined cut scene plays 52 00:04:00.024 --> 00:04:03.974 After that, even during the actual gameplay, 53 00:04:03.974 --> 00:04:06.724 the developer controls the camera at various points 54 00:04:06.724 --> 00:04:12.524 in the story to naturally guide the player's focus, 55 00:04:12.524 --> 00:04:17.974 while the player is still in control of the game 56 00:04:17.974 --> 00:04:21.424 hen, intentionally, after this cutscene, 57 00:04:21.424 --> 00:04:23.974 the player needs to press a button at this location, 58 00:04:26.024 --> 00:04:28.524 which appears to be a shrine, 59 00:04:28.524 --> 00:04:32.724 for it to work 60 00:04:34.524 --> 00:04:39.024 However, it informs the users about the location where this action occurs, 61 00:04:39.024 --> 00:04:41.474 even without pressing the button 62 00:04:41.474 --> 00:04:43.024 After that, the remaining parts of the story, 63 00:04:43.024 --> 00:04:45.874 which are linked, continue 64 00:04:48.074 --> 00:04:51.924 As you can see, cutscenes are 65 00:04:53.674 --> 00:04:58.424 now used continuously, unlike in the past, 66 00:04:58.424 --> 00:05:01.524 so it's important to keep that in mind 67 00:05:01.524 --> 00:05:05.874 By continuous, it means that the boundary between cut scenes 68 00:05:05.874 --> 00:05:10.724 and gameplay, as well as between user control, has almost disappeared 69 00:05:10.724 --> 00:05:14.974 You can think of it as meaning that the connection between them has become seamless 70 00:05:14.974 --> 00:05:18.974 The features for cutscene creation 71 00:05:18.974 --> 00:05:21.774 that you've seen are also included in Unity 72 00:05:21.774 --> 00:05:25.774 However, it's not included in the default project, 73 00:05:25.774 --> 00:05:27.224 so you need to go to the Cinemachine package 74 00:05:27.224 --> 00:05:31.124 in the Package Manager, navigate to the Unity Registry, 75 00:05:31.124 --> 00:05:34.074 and install Cinemachine 76 00:05:34.074 --> 00:05:36.874 This is the Package Manager window in Windows 77 00:05:36.874 --> 00:05:40.274 Cinemachine is used for camera control 78 00:05:40.274 --> 00:05:42.574 among these cutscenes 79 00:05:42.574 --> 00:05:45.974 Not only camera control, but also control of objects 80 00:05:45.974 --> 00:05:49.324 and other elements are all included 81 00:05:49.324 --> 00:05:52.374 in the Sequence feature here 82 00:05:52.374 --> 00:05:56.524 In the hierarchy, click the plus button and select Create Empty 83 00:05:56.524 --> 00:05:59.424 to create an empty object 84 00:05:59.424 --> 00:06:04.324 Set the position of the empty object to the world origin 85 00:06:04.324 --> 00:06:07.824 The object will be named Director 86 00:06:07.824 --> 00:06:11.774 This Director object will 87 00:06:11.774 --> 00:06:16.074 essentially act like the director on a movie set 88 00:06:16.074 --> 00:06:20.974 To direct the shooting, the director would need a script, of course 89 00:06:20.974 --> 00:06:24.374 The process of giving the director a script is 90 00:06:24.374 --> 00:06:30.324 essentially the process of creating a timeline asset 91 00:06:30.324 --> 00:06:35.174 When you click the Create button in the Timeline window 92 00:06:35.174 --> 00:06:38.074 you'll see that the Timeline is set 93 00:06:38.074 --> 00:06:43.124 to attach the Director component 94 00:06:43.124 --> 00:06:47.974 to the GameObject named Director 95 00:06:47.974 --> 00:06:51.624 So, the asset will be saved in a folder 96 00:06:51.624 --> 00:06:55.424 inside the Unity Assets folder, 97 00:06:55.424 --> 00:06:59.524 which you can create and name CinemachineCut 98 00:06:59.524 --> 00:07:02.624 You can think of it as 99 00:07:02.624 --> 00:07:06.374 the timeline script owned by the Director 100 00:07:06.374 --> 00:07:09.074 When you save it, 101 00:07:09.074 --> 00:07:12.724 As the PlayableDirector component is created, 102 00:07:12.724 --> 00:07:17.624 the asset we saved, named DirectorTimeline 103 00:07:17.624 --> 00:07:18.974 is also assigned to it 104 00:07:18.974 --> 00:07:22.424 You can actually perform this process manually as well 105 00:07:22.424 --> 00:07:26.724 If you search for Director in the Add Component menu, 106 00:07:26.724 --> 00:07:31.174 you'll find the PlayableDirector component 107 00:07:31.174 --> 00:07:33.124 that was automatically added 108 00:07:33.124 --> 00:07:35.774 Since it's already added, there's no need to add it again 109 00:07:35.774 --> 00:07:39.524 I'll tidy up the windows a bit 110 00:07:39.524 --> 00:07:43.674 by placing the Timeline window below the Scene view 111 00:07:43.674 --> 00:07:46.324 Then, I will switch between the Scene view and the Game view 112 00:07:46.324 --> 00:07:49.073 And in the Timeline window at the top, 113 00:07:49.073 --> 00:07:52.673 we will set up the predetermined sequences and directions for the cut scenes 114 00:07:53.023 --> 00:07:55.423 Before diving into the actual direction, 115 00:07:55.423 --> 00:07:59.423 you will need to come up with a simple scenario 116 00:07:59.423 --> 00:08:01.973 In the FPS we created, 117 00:08:01.973 --> 00:08:06.023 the player is currently positioned at the world origin, 118 00:08:06.023 --> 00:08:08.823 but the zombies are placed differently in the map 119 00:08:08.823 --> 00:08:10.523 where we were testing 120 00:08:10.523 --> 00:08:13.223 o, I will move three of the enemies, zombies 121 00:08:13.223 --> 00:08:19.573 temporarily to the outside of the scene 122 00:08:20.123 --> 00:08:25.623 So, we are going to capture the process of the player searching for the zombies 123 00:08:25.623 --> 00:08:28.373 First, the camera will slowly move forward 124 00:08:28.373 --> 00:08:32.873 in a shot from the front, while gradually zooming in on the player 125 00:08:32.873 --> 00:08:36.873 In the second shot, the camera will 126 00:08:36.873 --> 00:08:39.873 show the overall flow of the map 127 00:08:39.873 --> 00:08:42.273 Finally, as you're seeing now, 128 00:08:42.273 --> 00:08:46.223 the camera will move to the location 129 00:08:46.223 --> 00:08:48.673 where the zombies are, in order to show our target 130 00:08:48.673 --> 00:08:54.323 So, we will create a cut that first shows the player, 131 00:08:54.323 --> 00:08:58.123 then the map, and finally the target, 132 00:08:58.123 --> 00:09:00.573 following this sequence 133 00:09:01.123 --> 00:09:05.173 Now, we will register the objects according to the scenario 134 00:09:05.173 --> 00:09:06.473 and proceed with the direction 135 00:09:06.473 --> 00:09:10.123 First, select the Director object 136 00:09:10.123 --> 00:09:12.123 When you move 137 00:09:12.123 --> 00:09:15.223 or rotate another object, 138 00:09:15.223 --> 00:09:17.373 you'll see the Timeline window 139 00:09:17.373 --> 00:09:19.773 switch back and forth like this 140 00:09:19.773 --> 00:09:22.923 Since the Director object holds the timeline asset, 141 00:09:22.923 --> 00:09:27.073 the Timeline window for it will be visible 142 00:09:27.073 --> 00:09:29.073 However, when you select other objects, 143 00:09:29.073 --> 00:09:31.923 the Create button will appear again 144 00:09:31.923 --> 00:09:34.973 So, let's select the Director object 145 00:09:34.973 --> 00:09:38.273 and ock it with the padlock 146 00:09:38.273 --> 00:09:42.823 Now, even if you select other objects, 147 00:09:42.823 --> 00:09:46.323 the Timeline window will remain fixed, 148 00:09:46.323 --> 00:09:48.573 allowing you to direct smoothly and without interruption 149 00:09:48.573 --> 00:09:53.323 First, we will create the camera direction in the Timeline 150 00:09:53.323 --> 00:09:54.723 press the plus button 151 00:09:54.723 --> 00:09:58.023 Add a Cinemachine Track to the Timeline 152 00:09:58.023 --> 00:10:04.173 Just to note, the Cinemachine Track appears in the menu 153 00:10:04.173 --> 00:10:06.823 because the Cinemachine package has been installed 154 00:10:06.823 --> 00:10:09.073 First, add the Cinemachine Track 155 00:10:09.073 --> 00:10:13.223 Currently, the Cinemachine Brain is 156 00:10:13.223 --> 00:10:15.823 in a None state, meaning it is empty 157 00:10:15.823 --> 00:10:19.323 We will connect the Cinemachine Brain 158 00:10:19.323 --> 00:10:22.323 to the main camera here 159 00:10:22.323 --> 00:10:27.623 Then, by dragging the main camera into this slot, Create button, 160 00:10:27.623 --> 00:10:32.623 This will attach the Cinemachine Brain to the main camera 161 00:10:32.623 --> 00:10:34.373 When you click the Create button, 162 00:10:34.373 --> 00:10:38.523 a new component called CinemachineBrain 163 00:10:38.523 --> 00:10:43.273 is added below the main camera 164 00:10:43.273 --> 00:10:47.923 you can confirm that the Cinemachine icon on the right 165 00:10:47.923 --> 00:10:51.023 has been added to the main camera in the Hierarchy window 166 00:10:51.023 --> 00:10:52.623 In this current state, 167 00:10:52.623 --> 00:10:55.923 we need three camera directions 168 00:10:55.923 --> 00:10:59.373 If you look closely at the track, 169 00:10:59.373 --> 00:11:03.023 on the left, there's a section displaying the object list, 170 00:11:03.023 --> 00:11:07.373 and on the right, there's the timeline, which shows the flow of time 171 00:11:07.373 --> 00:11:10.523 The white line is called the indicator 172 00:11:10.523 --> 00:11:15.873 The timeline is aligned with the overall flow of time, 173 00:11:15.873 --> 00:11:20.923 and the indicator shows where you are 174 00:11:20.923 --> 00:11:25.923 As you can see, the time units are quite large, 175 00:11:25.923 --> 00:11:28.123 with numbers like 30, 60, 90, 120, and so on 176 00:11:28.123 --> 00:11:30.423 This is set in frame units 177 00:11:30.423 --> 00:11:32.423 You can change the display 178 00:11:32.423 --> 00:11:34.723 from frame units to seconds, 179 00:11:34.723 --> 00:11:39.423 which we commonly use, by clicking the settings button on the right side of the window 180 00:11:39.423 --> 00:11:42.573 For the Timeline, 181 00:11:42.573 --> 00:11:47.173 you can zoom out using the scroll bar at the bottom 182 00:11:47.923 --> 00:11:52.773 In the Cinemachine Track's timeline section, 183 00:11:52.773 --> 00:11:55.723 if you right click, you'll see the option Add Cinemachine Shot 184 00:11:55.723 --> 00:11:57.273 Let's add the Cinemachine Shot now 185 00:11:57.273 --> 00:12:00.923 Once you add the Cinemachine Shot, 186 00:12:00.923 --> 00:12:05.423 drag it to the position starting at 0 seconds to align it properly 187 00:12:05.423 --> 00:12:08.523 And once again, you're scrolling the wheel to adjust the view 188 00:12:08.523 --> 00:12:12.673 Right click again to add another Cinemachine Shot 189 00:12:12.673 --> 00:12:15.673 Now, there are a total of two Cinemachine Shots 190 00:12:15.673 --> 00:12:18.223 You can change the name of the shots 191 00:12:18.223 --> 00:12:24.123 The first shot will be set as the shot for zooming in on the player 192 00:12:24.123 --> 00:12:26.423 The second shot will be named MapBirdview 193 00:12:26.423 --> 00:12:29.923 It will be named as a shot for viewing from a distance 194 00:12:29.923 --> 00:12:34.473 Currently, you're seeing a yellow warning icon 195 00:12:34.473 --> 00:12:36.973 along with the text appearing in yellow 196 00:12:36.973 --> 00:12:42.073 The reason is that the Virtual Camera field here is 197 00:12:42.073 --> 00:12:44.273 in a None state, meaning it's empty 198 00:12:44.273 --> 00:12:47.173 If you click the Create button, 199 00:12:47.173 --> 00:12:51.473 a Virtual Camera will be created 200 00:12:51.473 --> 00:12:56.123 The Cinemachine feature we use 201 00:12:56.123 --> 00:12:59.173 involves things like Virtual Cameras 202 00:12:59.173 --> 00:13:02.523 Simply put, as you can see on the screen, 203 00:13:02.523 --> 00:13:05.472 the main camera and the virtual camera are overlapping 204 00:13:05.472 --> 00:13:08.172 If we move the virtual camera, 205 00:13:08.172 --> 00:13:12.572 the main camera will also move along with it, as you can see, it follows 206 00:13:12.572 --> 00:13:15.472 When the Cinemachine Brain is activated, 207 00:13:15.472 --> 00:13:18.522 it connects to the virtual camera 208 00:13:18.522 --> 00:13:21.122 through the Cinemachine Brain 209 00:13:21.122 --> 00:13:25.822 So, even if we only move the virtual camera, 210 00:13:25.822 --> 00:13:28.422 we can change the position 211 00:13:28.422 --> 00:13:31.372 and various properties of the main camera 212 00:13:31.822 --> 00:13:34.322 Once the virtual camera is registered, 213 00:13:34.322 --> 00:13:37.272 the white text and warning icon disappear 214 00:13:37.272 --> 00:13:40.622 Similarly, for the MapBirdviewShot, 215 00:13:40.622 --> 00:13:45.472 click Create to make Virtual Camera 1 216 00:13:45.472 --> 00:13:48.572 In this situation, once the timeline progresses 217 00:13:48.572 --> 00:13:52.772 and the 5 second area passes, 218 00:13:52.772 --> 00:13:56.872 the main camera will move to the location 219 00:13:56.872 --> 00:13:59.422 of the second virtual camera 220 00:13:59.422 --> 00:14:01.822 that we have set 221 00:14:01.822 --> 00:14:05.172 Let's set the positions of the main camera 222 00:14:05.172 --> 00:14:09.872 and the Birdview camera for the camera's representation 223 00:14:09.872 --> 00:14:12.822 Select the first virtual camera and position it 224 00:14:12.822 --> 00:14:16.672 so that it can view the player from a distance 225 00:14:16.672 --> 00:14:19.372 After selecting the virtual camera, 226 00:14:19.372 --> 00:14:23.772 go to GameObject and click Align With View 227 00:14:23.772 --> 00:14:26.622 This will position the virtual camera 228 00:14:26.622 --> 00:14:28.422 to face the player 229 00:14:28.422 --> 00:14:31.272 However, since the /view plus from isn't visible, 230 00:14:31.272 --> 00:14:33.122 it might be unclear if it's actually facing the player 231 00:14:33.122 --> 00:14:35.322 In that case, you can move the indicator 232 00:14:35.322 --> 00:14:39.222 to the camera view you want to display 233 00:14:39.222 --> 00:14:44.572 The main camera will follow, allowing you 234 00:14:44.572 --> 00:14:47.272 to preview the current view being shown 235 00:14:47.972 --> 00:14:50.872 The second one will be renamed 236 00:14:50.872 --> 00:14:54.672 to Map and the first one to 1 237 00:14:54.672 --> 00:14:58.972 Select the second virtual camera, 238 00:14:58.972 --> 00:15:01.572 which corresponds to the BirdviewShot, 239 00:15:01.572 --> 00:15:05.172 and move it to a position where the map's landscape is visible 240 00:15:05.172 --> 00:15:09.322 Once it's set, this position looks good 241 00:15:09.322 --> 00:15:12.722 Move the track and check how the main camera moves 242 00:15:12.722 --> 00:15:14.422 If you select Virtual Camera 2 243 00:15:14.422 --> 00:15:18.372 and choose GameObject, Align With View, 244 00:15:18.372 --> 00:15:21.572 you can confirm that the main camera is 245 00:15:21.572 --> 00:15:25.272 now showing the same view as the one you are looking at 246 00:15:25.272 --> 00:15:29.722 Finally, to show the zombies, 247 00:15:29.722 --> 00:15:33.572 place the three zombies in the space 248 00:15:33.572 --> 00:15:36.722 and add another Cinemachine Shot 249 00:15:36.722 --> 00:15:38.672 This time, click the Create button 250 00:15:38.672 --> 00:15:42.322 to create Virtual Camera 3 251 00:15:42.322 --> 00:15:45.972 So, in total, we have Virtual Cameras 1, 2, and 3 252 00:15:45.972 --> 00:15:49.922 The angle for Virtual Camera 3 is aligned using GameObject, Align With View, 253 00:15:49.922 --> 00:15:54.822 ensuring the main camera can view the zombies 254 00:15:54.822 --> 00:15:58.372 Now, all three cameras are set up 255 00:15:58.372 --> 00:16:00.872 If you check through the Game view now, 256 00:16:00.872 --> 00:16:03.272 In Camera 1, you can see the player, 257 00:16:03.272 --> 00:16:05.422 in Camera 2, the map is visible, 258 00:16:05.422 --> 00:16:07.872 and in Camera 3, the zombies are in view 259 00:16:07.872 --> 00:16:12.122 If the cuts are too abrupt and the transitions between shots are noticeable, 260 00:16:12.122 --> 00:16:14.822 it might make the experience uncomfortable for the users 261 00:16:14.822 --> 00:16:17.072 To make the transition smoother, 262 00:16:17.072 --> 00:16:21.022 click on Track 2 and shift it to the side 263 00:16:21.022 --> 00:16:24.872 This will allow it to blend with Camera 1, 264 00:16:24.872 --> 00:16:28.872 creating a blend over a 2 second interval 265 00:16:28.872 --> 00:16:32.772 Now, if you observe the overall camera movement, 266 00:16:32.772 --> 00:16:36.522 the camera first stays on Virtual Camera 1 for 2 seconds 267 00:16:36.522 --> 00:16:38.372 Then, it gradually transitions 268 00:16:38.372 --> 00:16:40.622 and moves to the area of Virtual Camera 2 269 00:16:40.622 --> 00:16:44.422 In the same context, we need to do the same for Virtual Camera 3 270 00:16:44.422 --> 00:16:47.272 However, the stationary duration in this section is too short 271 00:16:47.272 --> 00:16:50.222 Click the right side to extend the arrow horizontally, 272 00:16:50.222 --> 00:16:55.172 overlapping with Camera 3 273 00:16:55.172 --> 00:16:58.222 Then, set the duration to about 12 seconds 274 00:16:58.222 --> 00:17:02.222 so that it stops at the 12 second mark 275 00:17:02.222 --> 00:17:04.922 This will allow the camera movement 276 00:17:04.922 --> 00:17:08.322 to smoothly transition from Virtual Camera 1, 277 00:17:08.322 --> 00:17:12.622 to Virtual Camera 2, and finally to Virtual Camera 3 278 00:17:12.622 --> 00:17:16.722 You can adjust this interval by simply dragging it 279 00:17:16.722 --> 00:17:18.572 if you want to make it longer 280 00:17:18.572 --> 00:17:21.672 This is how the camera direction has been set up 281 00:17:21.672 --> 00:17:26.122 We've just checked the screen that users would see through the Game view 282 00:17:26.122 --> 00:17:28.672 But if you view it in the Scene view, 283 00:17:28.672 --> 00:17:31.172 the main camera moves like this 284 00:17:31.172 --> 00:17:33.622 Let's take a look from a bit farther away 285 00:17:33.622 --> 00:17:36.722 This is the angle seen by Virtual Camera 1 286 00:17:36.722 --> 00:17:41.072 It stays still for a moment and then smoothly transitions towards Virtual Camera 2 287 00:17:41.072 --> 00:17:42.622 It rotates while transitioning towards Virtual Camera 2 288 00:17:42.622 --> 00:17:44.572 To make it clearer for you, 289 00:17:44.572 --> 00:17:48.972 I will label Virtual Camera 1, Virtual Camera 2, 290 00:17:48.972 --> 00:17:52.572 nd Virtual Camera 3 here 291 00:17:52.572 --> 00:17:55.122 Since the main camera is moving, 292 00:17:55.122 --> 00:17:57.371 I won't label it separately 293 00:17:59.471 --> 00:18:09.021 You can see the movement from Camera 1 to Camera 2, 294 00:18:09.021 --> 00:18:11.571 and then from Camera 2 to Camera 3 295 00:18:11.571 --> 00:18:14.871 This is what a Virtual Camera looks lik 296 00:18:14.871 --> 00:18:19.921 What actually makes it work is the Cinemachine Brain 297 00:18:19.921 --> 00:18:22.321 The Cinemachine Brain determines 298 00:18:22.321 --> 00:18:27.521 when, where, and in which direction the camera should be 299 00:18:27.521 --> 00:18:30.821 The Virtual Camera acts like a save slot, 300 00:18:30.821 --> 00:18:34.421 storing the camera values for those specific times and positions 301 00:18:34.421 --> 00:18:37.371 That's why, instead of manually adjusting the camera every time, 302 00:18:37.371 --> 00:18:40.121 the Virtual Camera stores those changing values 303 00:18:40.121 --> 00:18:45.721 and applies them at the right moments according to the timeline 304 00:18:46.321 --> 00:18:50.921 This is how the Virtual Camera works and functions 305 00:18:50.921 --> 00:18:55.171 This system is what we refer to as Cinemachine 306 00:18:55.171 --> 00:18:59.221 Various direction techniques using Sequence tracks 307 00:18:59.671 --> 00:19:03.471 Now, let's try controlling the player 308 00:19:03.471 --> 00:19:07.471 Drag the player object into the track area 309 00:19:07.471 --> 00:19:10.921 on the left side of the Timeline 310 00:19:10.921 --> 00:19:13.971 and then add an Animation Track 311 00:19:13.971 --> 00:19:17.121 You can see the Animator field, and if you scroll down, 312 00:19:17.121 --> 00:19:20.171 you'll notice that the Animator component has been added 313 00:19:20.671 --> 00:19:25.021 In this situation, when the camera approaches at frame 0, 314 00:19:25.021 --> 00:19:28.771 it would be funny if the player is 315 00:19:28.771 --> 00:19:31.171 facing a wall, right? 316 00:19:31.171 --> 00:19:33.171 Since we have a path to follow, 317 00:19:33.171 --> 00:19:36.971 let's make sure the player faces the path naturally 318 00:19:36.971 --> 00:19:41.921 Click the "Start Recording" button at frame 0 to begin 319 00:19:41.921 --> 00:19:45.771 After that, use the rotation tool to rotate the player 320 00:19:45.771 --> 00:19:47.671 In the Inspector window 321 00:19:47.671 --> 00:19:52.371 you'll notice that the Rotation field is 322 00:19:52.371 --> 00:19:54.571 highlighted in red 323 00:19:54.571 --> 00:19:58.621 So, set the rotation to 90 degrees so that the player is facing forward 324 00:19:58.621 --> 00:20:01.171 That should be good now 325 00:20:04.271 --> 00:20:07.571 Since the position is too far forward, 326 00:20:07.571 --> 00:20:09.771 let's have the player start from a point further behind 327 00:20:09.771 --> 00:20:14.171 Move the player slightly back 328 00:20:14.171 --> 00:20:16.671 from the original position at frame 0, 329 00:20:16.671 --> 00:20:21.371 so that the movement towards the original position 330 00:20:21.371 --> 00:20:23.721 can occur smoothly 331 00:20:23.721 --> 00:20:26.971 Once you turn off the recording button, 332 00:20:26.971 --> 00:20:29.121 the player's position will now be saved, 333 00:20:29.121 --> 00:20:34.371 oriented towards the location you've set 334 00:20:34.371 --> 00:20:38.371 You can now see a dark blue color 335 00:20:38.371 --> 00:20:40.321 in the Inspector window 336 00:20:40.321 --> 00:20:43.421 Now, let's add an animation 337 00:20:43.421 --> 00:20:46.171 for the player to run forward 338 00:20:46.171 --> 00:20:48.171 until the camera looks up 339 00:20:48.171 --> 00:20:51.771 To have the player run forward, set the animation for about 4 seconds 340 00:20:51.771 --> 00:20:53.471 Then, press the record button again 341 00:20:53.471 --> 00:20:56.371 and move the player to the starting position 342 00:20:56.371 --> 00:20:59.221 the world origin, along the X and Z axes, 343 00:20:59.221 --> 00:21:05.321 you can see the keyframe being created for the player's position 344 00:21:05.321 --> 00:21:07.921 Since this value is now saved 345 00:21:07.921 --> 00:21:12.321 You can now see that the keyframe has been created for the player's position 346 00:21:12.321 --> 00:21:14.321 Let's stop recording 347 00:21:14.321 --> 00:21:16.371 So, when you play it later, 348 00:21:16.371 --> 00:21:20.471 you'll see that the player moves smoothly just as you see now 349 00:21:20.471 --> 00:21:22.321 The awkward part here is that 350 00:21:22.321 --> 00:21:24.971 since the game object is moving, 351 00:21:24.971 --> 00:21:27.921 the actual player mesh data 352 00:21:27.921 --> 00:21:31.321 isn't being animated, 353 00:21:31.321 --> 00:21:34.521 What's important here is that our player, 354 00:21:34.521 --> 00:21:38.421 by default, has a capsule shaped collider 355 00:21:38.421 --> 00:21:41.171 That's why the Soldier demo is the one performing the animation 356 00:21:41.171 --> 00:21:44.321 So, let's also add the Soldier demo to the setup 357 00:21:44.321 --> 00:21:46.221 to the Add Animation Track 358 00:21:46.221 --> 00:21:49.721 Afterward, if you check 359 00:21:49.721 --> 00:21:54.121 the animation sequences in the Soldier's setup 360 00:21:54.121 --> 00:21:57.571 you'll find a running animation under MoveBlend 361 00:21:57.571 --> 00:22:00.771 Drag the running animation 362 00:22:00.771 --> 00:22:03.521 and add it directly to the track 363 00:22:03.521 --> 00:22:06.171 Now, as you can see, 364 00:22:06.171 --> 00:22:10.121 the player smoothly moves 365 00:22:10.121 --> 00:22:14.571 However, due to the settings of this animation file, 366 00:22:14.571 --> 00:22:17.221 when you play it, 367 00:22:17.221 --> 00:22:20.071 you can see that the animation 368 00:22:20.071 --> 00:22:24.321 in the Animator for Soldier demo moves in the wrong direction 369 00:22:24.321 --> 00:22:27.121 So, by first setting the default position value 370 00:22:27.121 --> 00:22:30.171 to 0 and then playing it, 371 00:22:30.171 --> 00:22:33.271 you can see that the character is doing stationary running 372 00:22:33.271 --> 00:22:37.071 And then, set the Y axis to minus 90 degree 373 00:22:37.071 --> 00:22:41.871 In other words, if you set it to 0 degrees, you'll be able to see the walking animation 374 00:22:41.871 --> 00:22:46.571 However, while the player game object is moving forward 375 00:22:46.571 --> 00:22:48.871 he animation file is not following it 376 00:22:48.871 --> 00:22:52.671 At this point, turn off the Apply Root Motion option in the animation settings 377 00:22:52.671 --> 00:22:56.371 Once again, set the position X and Z to 0, 0, 378 00:22:56.371 --> 00:22:59.821 and configure it this way so that 379 00:22:59.821 --> 00:23:02.321 the Soldier demo animation 380 00:23:02.321 --> 00:23:04.621 follows the player object 381 00:23:04.621 --> 00:23:06.570 Since the Run animation is 382 00:23:06.570 --> 00:23:09.720 by default set to loop, 383 00:23:09.720 --> 00:23:12.420 if you stretch it to the desired duration, 384 00:23:12.420 --> 00:23:16.770 the animation will repeat continuously like this 385 00:23:17.270 --> 00:23:19.870 While playing, take a close look at the player's feet, 386 00:23:19.870 --> 00:23:22.420 as you can observe them more clearly now 387 00:23:22.420 --> 00:23:26.220 The player's feet are showing a common issue called icing, 388 00:23:26.220 --> 00:23:30.170 where it appears as though the feet are sliding in place while walking 389 00:23:30.170 --> 00:23:35.070 To avoid this issue, the player should move a bit faster 390 00:23:35.070 --> 00:23:37.370 To address this, 391 00:23:37.370 --> 00:23:39.670 double-click the player’s track not Soldier demo's track 392 00:23:39.670 --> 00:23:41.770 This will open the animation window 393 00:23:41.770 --> 00:23:45.320 where you can control each keyframe's values 394 00:23:45.320 --> 00:23:48.420 In this window, to reach the final destination faster, 395 00:23:48.420 --> 00:23:50.970 reduce the time to about 3 seconds 396 00:23:50.970 --> 00:23:54.520 After doing this, you should notice 397 00:23:54.520 --> 00:24:01.820 that the icing issue is 398 00:24:01.820 --> 00:24:03.970 reduced when the player runs 399 00:24:03.970 --> 00:24:06.120 Let's compare it again with the 4 second duration 400 00:24:06.120 --> 00:24:08.220 When it's set to 4 seconds, 401 00:24:08.220 --> 00:24:14.020 This causes the player's feet to slide 402 00:24:14.020 --> 00:24:17.520 On the other hand, when you reduce the duration to around 3 seconds 403 00:24:17.520 --> 00:24:23.870 you can see that as the player runs, the feet almost stay in place 404 00:24:23.870 --> 00:24:27.870 at the initial landing point 405 00:24:27.870 --> 00:24:30.570 When you view it through the Game view, it looks like this 406 00:24:30.570 --> 00:24:34.020 From the stationary screen, the player moves forward 407 00:24:34.020 --> 00:24:38.020 Meanwhile, the camera shows the distant background 408 00:24:38.020 --> 00:24:39.820 While the camera is focused on the distant background, 409 00:24:39.820 --> 00:24:43.320 the player is still in a shooting stance 410 00:24:43.320 --> 00:24:47.220 Then, it finishes by focusing on the zombies 411 00:24:47.220 --> 00:24:50.720 As the movement unfolds, let's create 412 00:24:50.720 --> 00:24:54.320 a fun and interesting direction using the Virtual Camera 413 00:24:54.320 --> 00:24:57.820 Since the camera is stationary while the player is running 414 00:24:57.820 --> 00:25:00.320 It looks very static, doesn't it? 415 00:25:00.320 --> 00:25:03.620 At this moment, select camera number 1 416 00:25:03.620 --> 00:25:06.620 Camera's noise section is set to None 417 00:25:06.620 --> 00:25:10.820 Give it a value of Basic Multi channel Perlin 418 00:25:10.820 --> 00:25:12.570 and Give a noise profile of 419 00:25:12.570 --> 00:25:17.620 Handheld wideangle strong in the bottom 420 00:25:17.970 --> 00:25:22.320 in the preview, Handheld method 421 00:25:22.320 --> 00:25:24.520 do not use indicator 422 00:25:24.520 --> 00:25:26.920 and click play button, 423 00:25:26.920 --> 00:25:30.970 you can see the screen shaking before moving 424 00:25:30.970 --> 00:25:34.220 Other than this, there also is widely used 425 00:25:34.220 --> 00:25:39.220 shaking effect based on 6 axes 426 00:25:39.220 --> 00:25:42.670 Feel free to find effects that you'd like to use 427 00:25:43.070 --> 00:25:46.370 If you look at the player now, 428 00:25:46.370 --> 00:25:50.870 the screen is not centered to the player character 429 00:25:50.870 --> 00:25:53.670 of course the player moves towards the center, 430 00:25:53.670 --> 00:25:55.620 right now if you see, 431 00:25:55.620 --> 00:25:59.570 screen center and the player center is a bit off 432 00:25:59.570 --> 00:26:04.320 Here, you can choose Aim part as Composer 433 00:26:04.320 --> 00:26:08.070 and then designate the Look At part 434 00:26:08.070 --> 00:26:10.970 as a Player Object 435 00:26:10.970 --> 00:26:15.270 then the yellow dot is looking at player's pivot 436 00:26:15.270 --> 00:26:20.020 So, use the offset value to set 0 5 for Y axis 437 00:26:20.020 --> 00:26:23.620 it actually should be 0 3 to be able to see the head 438 00:26:23.620 --> 00:26:27.770 if you set up with this value, no matter where player is running toward, 439 00:26:27.770 --> 00:26:31.620 this yellow dot would be 440 00:26:31.620 --> 00:26:33.920 fixed to player's head 441 00:26:33.920 --> 00:26:38.020 Now the screen is fixed to the player until the blending part 442 00:26:38.020 --> 00:26:42.170 through blending the camera transition smoothly 443 00:26:42.420 --> 00:26:45.170 Now, let's create a simple 444 00:26:45.170 --> 00:26:48.220 Fade in and out device 445 00:26:48.220 --> 00:26:52.870 First, under Cancas insert and image to UI 446 00:26:52.870 --> 00:26:54.920 Use Alt to fill the added image 447 00:26:54.920 --> 00:26:59.970 and stretch the anchor points 448 00:26:59.970 --> 00:27:03.220 in all directions 449 00:27:03.220 --> 00:27:06.020 and fill it with the black color 450 00:27:06.020 --> 00:27:12.220 Name the image as IMG FadeInOut 451 00:27:12.220 --> 00:27:14.970 and register it by dragging it like this 452 00:27:14.970 --> 00:27:17.720 added it as an animation track 453 00:27:17.720 --> 00:27:20.370 Typically, for Fade in and out, 454 00:27:20.370 --> 00:27:23.270 we make it so that from black screen, it gets brighter 455 00:27:23.270 --> 00:27:25.970 or from normal screen, the image gradually disappears 456 00:27:25.970 --> 00:27:28.370 That's how Fade in and Out are utilized 457 00:27:28.370 --> 00:27:33.720 to the IMG FadeInOut enable record button 458 00:27:33.720 --> 00:27:36.270 There's this property, color, in the image section 459 00:27:36.270 --> 00:27:39.920 if you move the value of alpha here, 460 00:27:39.920 --> 00:27:44.070 the change in alpha value is now recorded 461 00:27:44.070 --> 00:27:46.470 So let's click record button to end it 462 00:27:46.470 --> 00:27:49.370 You can see that the keyframe has been entered 463 00:27:49.370 --> 00:27:52.770 If you double click this, 464 00:27:52.770 --> 00:27:56.020 you can see that the color value of the image 465 00:27:56.020 --> 00:27:59.320 shows 1 at frame 0 when you slightly move the screen to the side 466 00:27:59.320 --> 00:28:03.170 If this is set to 0 for about 2 seconds 467 00:28:03.170 --> 00:28:05.920 If you play it gradually like this 468 00:28:05.920 --> 00:28:09.770 It should be more than 2 seconds 469 00:28:09.770 --> 00:28:13.869 If you play it again from frame 0, 470 00:28:15.069 --> 00:28:20.719 you can see the black color gradually disappearing from the screen 471 00:28:20.719 --> 00:28:25.269 You can freely drag this to make it longer 472 00:28:25.269 --> 00:28:27.969 and adjust the time as you wish 473 00:28:27.969 --> 00:28:30.719 If you play it again, you can see that 474 00:28:30.719 --> 00:28:34.719 when you reduce the scroll significantly, 475 00:28:34.719 --> 00:28:38.569 this is roughly the 1 second mark, and this part lasts for about 1 second 476 00:28:38.569 --> 00:28:42.369 And if you want it to change over 2 seconds, 477 00:28:42.369 --> 00:28:44.969 you can set the interval like this and play it again It will gradually brighten 478 00:28:44.969 --> 00:28:48.419 When doing a Fade In/Out, it would be better 479 00:28:48.419 --> 00:28:52.469 to place the 1 second interval where users can see the black screen for a short time, 480 00:28:52.469 --> 00:28:55.069 and set the 3 or 4 second interval here 481 00:28:55.069 --> 00:28:59.669 This way, users will experience a smoother and more natural Fade In, Out 482 00:28:59.669 --> 00:29:01.519 If you scroll the wheel a little more, 483 00:29:01.519 --> 00:29:06.119 we were originally making it fit into the 12 second interval, 484 00:29:06.119 --> 00:29:08.569 so place it around the 12 second mark 485 00:29:08.569 --> 00:29:12.519 Then, copy the color value that was 0 in that section by Ctrl C 486 00:29:12.519 --> 00:29:16.319 and paste it by Ctrl V at the 10-second mark 487 00:29:16.319 --> 00:29:21.369 This way, the value will remain 0 until that point 488 00:29:21.369 --> 00:29:22.919 let me increase the window 489 00:29:22.919 --> 00:29:27.369 Place it at the 1 second mark, 490 00:29:27.369 --> 00:29:30.069 then move the indicator and press Ctrl V 491 00:29:30.069 --> 00:29:33.269 This will organize the Fade In, Out sections like this 492 00:29:33.269 --> 00:29:34.969 let's trim it a bit 493 00:29:34.969 --> 00:29:37.319 Since this section is too long, let's shorten it a bit 494 00:29:37.319 --> 00:29:41.519 Now, when you play it, the Fade In,Out will gradually appear, 495 00:29:43.969 --> 00:29:53.469 showing the defined situations, and then it will end 496 00:29:53.469 --> 00:29:56.469 We've created the cut scene like this 497 00:29:56.469 --> 00:29:59.219 Now, let's see how we can use 498 00:29:59.219 --> 00:30:02.969 the created scene in actual gameplay 499 00:30:02.969 --> 00:30:05.369 First, if you select the Director game object, 500 00:30:05.369 --> 00:30:06.969 you'll see that 501 00:30:06.969 --> 00:30:10.469 Play On Awake option is checked 502 00:30:10.469 --> 00:30:15.269 So, simply pressing the play button 503 00:30:15.269 --> 00:30:17.769 will trigger the Cinemachine 504 00:30:17.769 --> 00:30:21.219 before any other code 505 00:30:23.719 --> 00:30:26.619 This way, we can't control the player directly 506 00:30:26.619 --> 00:30:28.519 The problem occurs when it ends 507 00:30:28.519 --> 00:30:31.169 It ended like this when it was finished 508 00:30:31.169 --> 00:30:33.819 And then it goes back to frame 0 509 00:30:33.819 --> 00:30:37.269 The issue is that we need to continue playing 510 00:30:37.269 --> 00:30:41.519 But the Cinemachine brain is still active, 511 00:30:41.519 --> 00:30:44.219 so the virtual camera is continuously 512 00:30:44.219 --> 00:30:47.219 following the player 513 00:30:47.219 --> 00:30:50.419 We will try to control this through code 514 00:30:50.419 --> 00:30:54.569 First, let's create a C sharp file in the Scripts folder 515 00:30:54.569 --> 00:30:56.769 The newly created file 516 00:30:56.769 --> 00:31:00.369 will be named DirectorAction 517 00:31:00.369 --> 00:31:05.319 Next, we'll assign the DirectorAction file 518 00:31:05.319 --> 00:31:08.269 to the Director game object 519 00:31:08.269 --> 00:31:11.719 Double click to open it in Visual Studio 520 00:31:11.719 --> 00:31:15.769 To use the basic Cinemachine features, 521 00:31:15.769 --> 00:31:18.319 we first need to set up the namespace 522 00:31:18.319 --> 00:31:23.769 The Playable item provided by Unity Engine is 523 00:31:23.769 --> 00:31:26.719 necessary because it contains information related to the Director 524 00:31:26.719 --> 00:31:30.619 More specifically, it's needed to access 525 00:31:30.619 --> 00:31:32.819 the PlayableDirector component information 526 00:31:32.819 --> 00:31:35.319 For Cinemachine, we declared it this way 527 00:31:35.319 --> 00:31:40.619 in order to control the Cinemachine Brain directly 528 00:31:40.619 --> 00:31:45.369 At the start, we created a variable of type 529 00:31:45.369 --> 00:31:48.069 PlayableDirector to store the component 530 00:31:48.069 --> 00:31:52.069 We created a variable called pd for the PlayableDirector, 531 00:31:52.319 --> 00:31:59.219 and this corresponds to the Director game object 532 00:32:00.869 --> 00:32:02.719 Then, into this pd, 533 00:32:02.719 --> 00:32:05.519 we get the PlayableDirector component 534 00:32:05.519 --> 00:32:09.119 and command it to play 535 00:32:10.419 --> 00:32:15.019 This is important now, in the update, what we will do is 536 00:32:15.019 --> 00:32:19.919 current time, the time being referred to here is 537 00:32:19.919 --> 00:32:21.969 the playback time of the ongoing sequence 538 00:32:21.969 --> 00:32:24.769 So, when the timeline bar is at 0, 539 00:32:24.769 --> 00:32:26.969 the value 0 will be output, 540 00:32:26.969 --> 00:32:31.369 when it's at 2, 2, when it's at 3, 3, and at 8, 8, 541 00:32:31.369 --> 00:32:33.819 continuing in this way 542 00:32:34.519 --> 00:32:36.869 The Duration refers to 543 00:32:36.869 --> 00:32:41.419 the last playback time where the blue marker is placed 544 00:32:41.419 --> 00:32:44.969 This is recognized as the duration 545 00:32:45.469 --> 00:32:48.519 So, if the current playback time 546 00:32:48.519 --> 00:32:53.669 reaches or exceeds the final play time 547 00:32:53.669 --> 00:32:56.619 this is a safety measure to allow for a slight increase 548 00:32:58.219 --> 00:33:01.869 When the current playback time equals the Duration, 549 00:33:01.869 --> 00:33:07.269 it means the sequence has finished; one cycle is complete 550 00:33:07.269 --> 00:33:10.969 So, disable the Cinemachine Brain 551 00:33:10.969 --> 00:33:14.419 on the main camera by setting it to false, 552 00:33:14.419 --> 00:33:17.619 which frees it from the virtual camera 553 00:33:17.619 --> 00:33:19.569 Additionally, 554 00:33:19.569 --> 00:33:23.419 set the pd game object to inactive 555 00:33:23.419 --> 00:33:27.319 by setting it to false, then what do we do? 556 00:33:27.319 --> 00:33:29.869 ensures that the pd no longer functions 557 00:33:29.869 --> 00:33:33.618 We just created the code in a simple way 558 00:33:36.918 --> 00:33:39.418 Now, let's play it 559 00:33:39.418 --> 00:33:44.418 and see how the components behave in action 560 00:33:44.418 --> 00:33:49.668 When you press play, and think about the situation right after, 561 00:33:49.668 --> 00:33:52.018 both the Director and 562 00:33:52.018 --> 00:33:55.268 the Cinemachine Brain will be active 563 00:33:55.268 --> 00:33:57.518 Let's go ahead and play it 564 00:33:58.268 --> 00:34:01.068 Right after pressing play, 565 00:34:01.068 --> 00:34:04.618 the Brain will be active, and the Director will also be activated 566 00:34:04.618 --> 00:34:07.918 In this state, the timeline 567 00:34:07.918 --> 00:34:11.518 will continue to progress, with the current time moving from 8s, 9s, 10s, and so on 568 00:34:11.518 --> 00:34:14.368 Once it reaches the Duration of 12 seconds, 569 00:34:14.368 --> 00:34:17.268 the Director will be deactivated, 570 00:34:17.268 --> 00:34:20.568 and the Cinemachine Brain on the main camera 571 00:34:20.568 --> 00:34:22.918 will also be deactivated 572 00:34:23.418 --> 00:34:29.118 By the way, the Director has 573 00:34:29.118 --> 00:34:33.318 a Wrap Mode, which we changed to Hold, 574 00:34:33.318 --> 00:34:35.318 and we disabled Play On Awake 575 00:34:35.318 --> 00:34:38.318 To play it at the desired time, 576 00:34:39.318 --> 00:34:44.018 in this state, and move around 577 00:34:44.018 --> 00:34:46.418 Let's turn off the UI briefly, 578 00:34:46.418 --> 00:34:50.618 If we turn off the IMG FadeInOut UI in the Canvas, 579 00:34:52.818 --> 00:34:57.468 you can see that the player is actually 580 00:34:57.468 --> 00:35:04.318 functioning and moving like this 581 00:35:04.318 --> 00:35:09.268 But since the IMG FadeInOut was turned on, it wasn't visible before 582 00:35:10.668 --> 00:35:13.018 From your perspective, you might think 583 00:35:13.018 --> 00:35:17.768 that we can just set the UI to false in the code 584 00:35:18.468 --> 00:35:22.118 when we set Active value to false for everything 585 00:35:22.118 --> 00:35:26.668 However, if we do that, 586 00:35:26.668 --> 00:35:30.068 some things would be controlled through the code, 587 00:35:30.068 --> 00:35:34.218 while others would be controlled through Cinemachine by adjusting the alpha value amking it inconvinient 588 00:35:34.968 --> 00:35:42.268 hat's why we will drag the IMG FadeInOut 589 00:35:42.268 --> 00:35:45.968 and add an Activation Track this time 590 00:35:46.668 --> 00:35:49.618 Then, an Activation Track will be created 591 00:35:49.618 --> 00:35:52.918 What this track does is quite simple 592 00:35:55.218 --> 00:35:58.618 Within the Activation Track section, 593 00:35:58.618 --> 00:36:04.468 the IMG FadeInOut that we created will be activated 594 00:36:04.468 --> 00:36:08.368 On the other hand, once it goes beyond the Activation section, 595 00:36:08.368 --> 00:36:12.268 the IMG_FadeInOut object 596 00:36:12.268 --> 00:36:14.368 will automatically be disabled 597 00:36:14.368 --> 00:36:17.968 That's why, by setting it to active 598 00:36:17.968 --> 00:36:22.968 only during the entire playback period, 599 00:36:22.968 --> 00:36:30.868 it will automatically turn off at the end of the active period 600 00:36:30.868 --> 00:36:33.918 allowing the screen to naturally disappear 601 00:36:33.918 --> 00:36:35.618 So if you play it, 602 00:36:40.568 --> 00:36:44.568 As you can see, the image remains active 603 00:36:44.568 --> 00:36:49.118 because it's within the active section 604 00:36:49.118 --> 00:36:52.718 When the fade out happens and it ends, 605 00:36:52.718 --> 00:36:55.618 many mistakes can occur 606 00:36:56.418 --> 00:37:03.918 Since it only turns off when it exits this section, 607 00:37:03.918 --> 00:37:09.218 if you try to match the end exactly, it won't end correctly 608 00:37:09.218 --> 00:37:11.568 Now it doesn't disappear 609 00:37:11.568 --> 00:37:15.268 So, when using the Activation Track, 610 00:37:15.268 --> 00:37:22.918 if you shift the end by just one frame inward, 611 00:37:22.918 --> 00:37:27.268 since it will turn off as false setting, 612 00:37:27.268 --> 00:37:32.018 This makes it easier to organize, and When you play it, 613 00:37:48.618 --> 00:37:52.318 everything will be properly cleaned up like this 614 00:37:54.218 --> 00:37:59.068 We briefly covered how to create cutscenes using Cinemachine, 615 00:37:59.068 --> 00:38:03.668 how to move the camera, 616 00:38:03.668 --> 00:38:06.668 and how to use tracks 617 00:38:06.668 --> 00:38:08.918 The most basic approach is this 618 00:38:08.918 --> 00:38:12.268 Controlling this manually with code can be difficult 619 00:38:12.268 --> 00:38:15.468 Right now, we've applied 620 00:38:15.468 --> 00:38:19.868 animations for a total of 5 objects 621 00:38:19.868 --> 00:38:23.518 within the timeline asset 622 00:38:23.518 --> 00:38:28.468 If we were to do this without using a timeline asset, 623 00:38:28.468 --> 00:38:32.318 we would need to create assets and manually connect them, 624 00:38:32.318 --> 00:38:34.617 then control them through separate functions 625 00:38:34.617 --> 00:38:37.017 A lot of unnecessary assets 626 00:38:37.017 --> 00:38:40.167 and one time assets would be created, 627 00:38:40.167 --> 00:38:43.617 and managing them without missing any files 628 00:38:43.617 --> 00:38:45.967 to properly organize the sequences would be challenging 629 00:38:45.967 --> 00:38:49.567 By using the timeline feature for various sequences, 630 00:38:49.567 --> 00:38:55.217 you can keep the assets limited to just one, 631 00:38:55.217 --> 00:38:57.667 and since everything is managed in one place, 632 00:38:57.667 --> 00:39:02.017 it makes editing much easier and more convenient for everyone 633 00:39:02.717 --> 00:39:05.717 I hope that as you create content, 634 00:39:05.717 --> 00:39:08.967 you'll be able to achieve great results 635 00:39:08.967 --> 00:39:12.417 by utilizing these various features 636 00:39:13.017 --> 00:39:16.717 In this lecture, we created a cutscene using 637 00:39:16.717 --> 00:39:18.867 Cinemachine and Sequences 638 00:39:18.867 --> 00:39:22.217 We explored how to manage complex and diverse scenarios 639 00:39:22.217 --> 00:39:27.167 through sequence tracks without the need for scripts 640 00:39:27.567 --> 00:39:31.517 When creating a cutscene, it's important to focus on clearly 641 00:39:31.517 --> 00:39:34.867 conveying the intended message , and attention is needed 642 00:39:34.867 --> 00:39:36.917 to ensure the goal is communicated effectively 643 00:39:36.917 --> 00:39:40.667 This concludes the lecture on the beta version 644 00:39:41.417 --> 00:39:42.367 Creating cutscenes using Cinemachine and Sequences 645 00:39:42.367 --> 00:39:43.367 Cut Scene, A noninteractive video sequence that directs elements such as the opening, ending, and key story moments 646 00:39:43.367 --> 00:39:44.367 In the past, cutscene videos and gameplay 3D were used separately 647 00:39:44.367 --> 00:39:45.367 Recently, the boundary between cutscenes and gameplay has become blurred 648 00:39:45.367 --> 00:39:46.367 Cutscene scenario flow Player zoom in to Show map overview to Confirm target 649 00:39:46.367 --> 00:39:46.867 Cutscene creation, In the Window menu, go to Package Manager, select Cinemachine, and click the Install button 650 00:39:46.867 --> 00:39:47.367 Window, Sequencing, Select the Timeline window 651 00:39:47.367 --> 00:39:47.867 Create an empty object in the Hierarchy window, align it to the world origin, and rename it to Director 652 00:39:47.867 --> 00:39:48.367 Create a CinemachineCut folder in the Assets directory, and save the DirectorTimeline.playable file inside it 653 00:39:48.367 --> 00:39:48.867 In the Timeline window, create a Cinemachine Track, and drag and drop the main camera into the Cinemachine Track 654 00:39:48.867 --> 00:39:49.367 Right-click in the Timeline window, then select Add Cinemachine Shot to create a slot 655 00:39:49.367 --> 00:39:49.867 Click the Create button on the right side of the Virtual Camera in the Inspector window to create a Virtual Camera object 656 00:39:49.867 --> 00:39:50.367 Create two more Virtual Camera slots, one for showing the map overview and another for the zombie 657 00:39:50.367 --> 00:39:50.867 Drag the Virtual Camera tracks to set them up for blending 658 00:39:50.867 --> 00:39:51.367 Check the movement path of the Virtual Camera in the Scene view 659 00:39:51.367 --> 00:39:51.867 Various sequences using the Sequence Track 660 00:39:51.867 --> 00:39:52.367 Player direction, Drag the Player object into the track area on the left side of the Timeline 661 00:39:52.367 --> 00:39:52.867 Add it with the Add Animation Track option Then, click the Start Recording button at frame 0 662 00:39:52.867 --> 00:39:53.367 Change the Y rotation value to 90 to make the camera face the desired direction 663 00:39:53.367 --> 00:39:53.867 Move the player's position backward 664 00:39:53.867 --> 00:39:54.367 Place the indicator at the 4 second mark, click the Start Recording button, and move the player to the position where the X value is 0 665 00:39:54.367 --> 00:39:54.867 Drag the Soldier_demo object into the Timeline and add it to the Animation Track 666 00:39:54.867 --> 00:39:55.367 Drag the demo combat run animation and add it to the Soldier demo track 667 00:39:55.367 --> 00:39:55.867 Set the X and Z position values of Soldier_demo to 0, and change the Y rotation value to 0 668 00:39:55.867 --> 00:39:56.367 Uncheck the Apply Root Motion option for the Soldier_demo animation, and set the X and Z position values to 0 669 00:39:56.367 --> 00:39:57.217 Fade In, Out direction 670 00:39:57.217 --> 00:39:58.017 In the Hierarchy window, select the Canvas item, then choose UI Image and set it to IMG FadeInOut 671 00:39:58.017 --> 00:39:58.817 Change the Anchor preset to Stretch for both horizontal and vertical, and set the Color to black 672 00:39:58.817 --> 00:39:59.667 Drag the IMG_FadeInOut object into the Timeline and add it to the Animation Track 673 00:39:59.667 --> 00:40:00.467 Click the Start Recording button on the IMG FadeInOut track, then adjust the A (opacity) value in the Image component 674 00:40:00.467 --> 00:40:01.267 Set the Fade In, Out section 675 00:40:01.267 --> 00:40:01.817 Applying cutscenes to actual gameplay direction 676 00:40:01.817 --> 00:40:02.367 In the Project window, go to the Scripts folder, select Create - C sharp Script, and name it DirectorAction 677 00:40:02.367 --> 00:40:02.917 Select the Director object, then drag and drop the DirectorAction script into the Inspector window 678 00:40:02.917 --> 00:40:03.467 In DirectorAction.cs, set up the namespace for controlling Cinemachine 679 00:40:03.467 --> 00:40:04.017 Create a pd variable to control the PlayableDirector 680 00:40:04.017 --> 00:40:04.567 To disable the Director object and the main camera's Cinemachine Brain upon ending 681 00:40:04.567 --> 00:40:05.117 Set the Wrap Mode of the Director object to Hold and uncheck Play On Awake 682 00:40:05.117 --> 00:40:05.667 Drag the IMG_FadeInOut object into the Timeline and select Add Activation Track to add it 683 00:40:05.667 --> 00:40:06.267 Set the Active slot to end about one frame before the entire timeline ends