Unity 2021 Timeline and Cinemachine Tutorial - Part 1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi this is michael from expanse vr and in this first of a two-part how-to series video i will be covering timelines and more importantly in the second part we'll be covering cinemachine and how to use it along with timelines to make some great cutscenes for your game so kicking off with timelines the first thing you guys guessed is to describe what exactly timeline is timeline is unity's visual editor for all our creative content like animations our camera systems audio systems and can even be used for the particle systems for more complex um particle animations and if you've used anything like premiere pro or any of the other sort of video editing software it works in a very similar way in the fact that we have tracks and we add sequences to them and we can even blend them to make things a lot more smooth and streamlined and if you have a look at this sequence here which is something that i put together for one of the other videos and this is a small little project i'm working on you can see here we've got the two different tracks first one is just the animation tracks for our soldier here in the screen and the other one is actually for the cameras which you will be seeing in the next video when we work with a cinemachine and as i scrub through the timeline you can see our soldier running through his animations and now we're here switching through the different cameras the different virtual cameras and back again and also just onto different animations all done seamlessly and you can see that everything blends together very well and this is the power of timelines it makes doing this very easily and most importantly with little or no scripting involved so at the start of the video you would have seen this little cut scene that i put together in the high definition render pipeline and this is just to demonstrate how you can make a very nice cinematic cut scene and we'll be covering this more in the next video but i don't want you to be overwhelmed with everything that's going on so first off we're going to start with a much simpler scene and if you're new to the channel don't forget to like this video subscribe to the channel and of course click that notification button down below to make sure you are notified whenever i post a new tutorial for you so here we are in our blank scene and the first thing we need to do is go into package manager and we need to look in the unity register for cinemachine center machine is a free asset from unity and you can use this in whichever build that you are happy with myself i'm using 20 20.3 lts as that's the most stable version at the moment but you can use any one including the latest one at the moment which is 2021.2 as of this video so once you've found it you just click on install and once it's finished you'll see at the top of unity now we have a new menu uh cinemachine this in here has all the options we need for a city machine in our project now just quickly we're going to add two other things into our project first one if we just go down to animation we're going to add an animator window because we'll be using this for some of our virtual cameras and we'll just dock that down there to make it a bit easier and also i'm going to go down to sequencing and we're going to open up the timeline window as well and once again just dock that down below so the next step i'm going to be doing is just quickly setting up a scene i'm going to be using the polygon prototype pack from cinti which is five dollars on the asset store but if you keep an eye out they do offer for free on occasions which is what i grabbed from before now it's not too important or what you put in the scene so just go crazy have a little bit of fun with it the only thing that is important is that you have a character in there that you can animate and maybe one or two props that can be animated though that second part is not too important so at the moment i've got a very simple scene and i've just imported and set up a few animations myself the actual animations aren't covered in this video if you would like to see how to animate objects if you don't know how to do that already just comment below and i will look into doing a video that in the future but for the time being the animations i've got so far are just a driving forward animation for the car so if we push play you'll see that happen now just drives forward to a spot and my character has a few different animations here so at the moment it's just an idol a wave a bit of a look around and i've also got a walk one in there which i haven't actually plugged in just yet because we're going to do this in a slightly different way than you normally would using timeline and the cinemachine so the very first thing that we need to do is create our first timeline and what are we going to do here is just create a folder to store them in and then what we do to create a timeline is that we need to create click on an object so here we just do the sports card doesn't really matter click create timelines and i'll just name this intro timeline and what we will do from here is actually pull in the car first and we're going to add an animation track and from there we'll also add in our character same again animation track and then we need to add the actual animation clip so add from animation clip we select driving forward and the first thing you're going to notice is that our car has been repositioned and that's really easy to fix if we come over to the right hand side here for the actual animation so if we're clicking on here this guy here and click on the gizmo for this we can actually reposition him back to where we originally wanted him so we just click on the gizmo here and we pull it to the position that we want and if i click the play button now you'll see that it moves forward as we need it now the great thing about timeline is that if we want we can actually move this further along now so when i push play it starts from there and if i push play on the actual game same thing instead of the animation happening straight away it's going to wait a second and then go and what we're going to do is the same thing for our character so if we right click and add animation clip we're going to add the humanoid walking and we have our same problem where it's not in the right position so we're going to just drag this over to around about where the door is and rotate around to face in the general direction and the same thing we're going to see here is you're going to start walking and what we can do is extend this out so that it continues to walk to roughly the front door it's about there now there are some drawbacks to this this only works on a flat surface for our character here same with the car and there are other ways to get around that which we'll cover in another video if i get people requesting it but for the moment this is enough and same thing again we don't want it to happen exactly straight away so we are going to just move that forward a little bit so the car pulls up he starts walking along towards the door now if we push play we notice that our guy isn't doing anything beforehand so what we need to do here is add another clip which will be our idle and what we can do here because as you see it's something jumps we've got the same problem so what we can do from here is right click and match offset to next clip so now let's put it all the way back here and what we can do is bring it up to this point and we should see this blend into our animation here and what are we going to do at the end let's just have him have a quick look around set another animation click look around this time right click match offset from previous clip bring it back and we'll do that there so it should now blend nicely i'll right click here copy and paste same thing again match offset to previous clip so he's going to have a look around and then come back together to have his little idol stand so if we play our video now looks around and comes back together not the best animations working together but you get the general gist and we're going to use the cameras to actually cut through a few different things so we're just going to make one quick change to this we're just going to get rid of the idle one at the beginning because our player actually isn't going to be there at the beginning of the sequence we're actually going to make him appear and we do that by using events and in timeline we don't actually call them events we call them signals for some reason so the first thing we need to do is just to right click on the bar here and show markers that's if you don't have that already and we're going to right click where we want it and we're going to add a signal emitter and once that's done the next step is to actually create our signal and once we click on that i'm just going to go into my timelines folder and create a new folder to store my signals and i'm just going to name this one car arrived so the next part is that we just need to actually create something to receive the signal and we're going to do that by creating a script and attaching it to an object which is both required for a signal receiver so we're going to start off with a new class we're going to call this one intro manager and same thing create an empty game object and name it intro manager as well then just jumping into visual studio i'm going to create a serialized field to hold the game object which will be our player character i'll just name that one player we don't need any of this and i'm just going to create a public method called reveal player and all it's simply going to do is set it to active we then having attached it already to the script we just add our character to it deactivate the character and now we just go to our signal add a new signal receiver and then just attach that actual game object and script and call up the method and from that it should simply work as easy as that and there's our player just popping up from the signal being received and that is it for this episode in the next one we will continue on and get into cinemachine and using that along with timeline to continue making this sort of intro scene and of course i'll show you how that other scene from the beginning uh works and how we came about with that one and as always thank you for watching if you have any questions make sure to hit me up in the discord channel link is below and we'll see you in the next video and thanks for watching don't forget to like and share to help grow our beautiful unity community and don't forget to hit that subscribe and notification button below to make sure you get to see our next video see you shortly
Info
Channel: ExpanseVR
Views: 19,136
Rating: undefined out of 5
Keywords: unity3d, unity3d tutorial, unity 3d, unity tutorial, game dev, brackeys, unity3d college, unity game development, unity 3d tutorial, unity tutorials, unity tutorial for beginners, indie game development, indie game dev, unity game dev, state machine c#, unity 2021, code monkey, cinemachine, unity timeline, unity timeline camera animation, unity cinemachine tutorial, unity cinemachine, unity timeline cinemachine, unity cinematic tutorial
Id: fHbgWn5XDQA
Channel Id: undefined
Length: 14min 39sec (879 seconds)
Published: Tue Sep 21 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.