Intro to Unity Timeline

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Hey, Brackeys. As always, love your videos. I have a question to ask, are you going to make a video on skill trees and such? Thanks!

👍︎︎ 1 👤︎︎ u/123skh123 📅︎︎ Oct 12 2017 đź—«︎ replies
Captions
in this video we'll have a look at the new timeline editor in unity 2017 we'll have a look at how you can add and combine different types of tracks to create cutscenes and call events also special thanks to German and hence have tuned for their support on patreon let's get into it so we have a cymbal scene that consists of four vehicles a hangar environment and of course a camera the vehicles are from Devas it's and I will of course have a link for them in the description now to open up timeline we go window and select the timeline editor I'm just gonna dark this down by the animation panel and the first thing that we're going to do is create an empty game object where our timeline data can sit let's go to a hierarchy go right-click create empty let's reset the transform on this let's rename it to timeline and you can see now that inside of the timeline window it says to begin a new timeline create a director component and a timeline asset now it can do this for us if we simply hit create first we get to name our timeline asset this is also what we refer to as a playable and we can just call this our cutscene let's then hit save and you can see now that the cutscene appears in the project you will also see that it's added two components to our timeline the first one is a playable director and this reference is our cutscene playable object here we're gonna just stuff like whether or not we wanted to play when we start the game and whether or not we wanted to loop once it's done it also created an animator component and this is actually not something that we need this is just because timeline assumes that the object that you create the timeline on is going to be animated as well and you can see down here in our timeline window we now have a timeline that we can scrub through and we have a single track this track refers to the timeline object itself so we can actually just delete this because we don't want to be animating our timeline object and we can actually go and select that and remove the animator as well so now we have no tracks in our timeline let's go ahead and add a new one and here we have a bunch of different ones to choose from we're going to be creating an animation track this is probably the most common track and it's what we use whenever we want to play animation in our game now I don't have any animation done yet so I simply want to take the object that I want to animate which is the big t90 in the center here and drag it into this slot it's then gonna prompt me to create an animator on this t90 which I'll just go ahead and do I can simply hit the record button and I can then start keyframing different parts of my t90 I'm gonna find the turret pivot find a good start rotation go forward a bit on the timeline and right now this is displayed in frames we can change this by going to the COG and selecting seconds instead I think 3 seconds sounds about right I can then rotate it over and it's going to insert a keyframe and we can now see that this is animating over time I also want to animate my gun pivot so I'm gonna go back a few frames set the starting keyframe here about there seems right go forward a little bit and I'm going to animate this up so now we can stop recording go back and hit play and we can see our animation plane if you then want to go back and edit your animation we can click the curves here to edit the individual curves or we can simply double click on the track to be taken to the animation window here we can make our adjustments and as soon as we go back to timeline we can see the changes but right now we are only animating one object and the strength of timeline is the ability to mix together multiple animations let's go and add another one this time that's reference our HMMWV over here let's drag him in and create an animator on him again let's hit record I'm gonna select the HMMWV set a start position move forward in time a bit and animate him forward so now as we scrub through we can see our two animations playing together let's stop recording and right now we can see and adjust all of the individual keyframes but if you have a lot of objects in here this quickly becomes very hard to manage and we can't really adjust the timing between these two Clips without going in and editing the keyframes let's first right click on a t90 track and hit convert to clip track this is going to take all of our keyframes and turn them into one single clip that we can easily manage we can select this clip and rename it to say T 90 aim and let's also do the same thing for a humvee so let's right click go convert to clip track and let's name this humbly drive and now we can mix these together in any way that we want we can change the timing or we can even adjust the length of these clips if we now hit play we can see that our T 90 starts aiming long before are hungry starts driving but after our T 90 finishes its aim it simply freezes if we click on the T 90 clip we can change this by going under post extrapolate this means what happens to the animation after it's done playing and right now it's just set to hold so whatever the end frame it will just hold that into infinity but let's try and change this to something like ping pong this means as soon as the animation reaches its end it will play back in Reverse so if you now play our sequence we should see that the t90 keeps animating and indeed it does of course we want to stay organized in our timeline let's go add to create a track group here we can group together multiple tracks let's rename this to vehicles and let's drag in both our tracks now the next type of track that we want to look at is the activation track this allows us to simply enable or disable a game object it's really that simple and in the scene here I actually have two cameras I have a camera that focuses on the t90 and I have a camera that focuses on the Humvee so in our timeline we can use the activation track to switch between them we want to start with the camera on the t90 we can then add a nadi activation track and here we can reference the camera on a Humvee so in the beginning we only want the camera on the t90 to be active let's drag out the camera on a Humvee and then after a little while we can switch over to the Humvee camera so if we now open up our vehicles group we can see that we switch the camera right before the Humvee starts driving and then as it exits the frame we can go back to our original camera to do that we select the clip hit control D or command T if you're on the Mac to duplicate and simply drag it over and we can also extend the lifetime here to the end of our timeline so now if we play this back we should see that we have some nice switching between the cameras and it's actually starting to look like a cutscene let's again go ahead and add a track group for our new camera controls let's drag both our camera tracks in there you can of course also add pre-made animation to our timeline so if you want your character to play some animation we could simply add an animation track you would then link the character and then you can simply drag in animation clips to add them together so it basically works in the exact same way that it did with our vehicles and I think this is probably the best part about timeline is that you can basically drag in anything you'd like and it's just gonna play it a good example of this is sound so if we go under our sounds folder I have two sounds here I have some ambience and I have an engine start we can simply take our ambience and drag it into timeline it's gonna automatically create an audio track for us and we can simply make the clip a bit shorter a really cool thing is to focus on a clip you can simply select it and hit F just like you would in the scene you so let's now trim this to fill out the entire sequence and I also want to add the engine start now this has a bit of room before the engine actually starts if you're going here we can actually see that it's around 2 seconds let's take our engine start drag it into timeline let's trim it for about 2 seconds let's then open up our vehicles that we can see when our Humvee starts driving let's start the engine just a tad before that now if you hit play your sound won't preview unfortunately you still have to play the game in order to hear your sound working so let's press play to try it out when definitely hear the ambience and maybe we a bit too late on the engine side to fix that we'll simply drag the clip a tiny bit to the left let's again try and hit play and this time it works beautifully finally let's make sure to trim our engine start sound to the timeline length as well and just to clean everything up we can add a track group fall of our audio so that should be it for our preview of the timeline editor awesome so of course timeline is still very new and I'm definitely excited to see where they'll take it from here but I think the tools already a great starting point for creating cutscenes and in-game events and now that we have timeline I definitely hope to see more short films made with unity so if you make something cool using the timeline definitely make sure to send it to me at brackets wait over on Twitter and that thanks watching and I will see you in the next video thanks to all the awesome patreon supporters who donated in September and especially thanks to Judah Minh hence often Zig Jabalia Superman the great James P yes for magazines Thomas volley Sybok mummy Jason Tito Derrick Eames Kirk fey sommer Phi Nick Lang who some Gaza Aaron Robert pun and Peter Locke if your name's not on the list I'll make sure to include you later this month and the next month as well
Info
Channel: Brackeys
Views: 259,579
Rating: undefined out of 5
Keywords: brackeys, unity, unity3d, asset, assets, model, models, beginner, easy, how, to, howto, learn, course, tutorial, tutorials, game, development, develop, games, programming, basic, basics, timeline, Unity 2017, 2017, time, line, sequence tool, sequencer, tool, animation, cutscene, animations
Id: G_uBFM3YUF4
Channel Id: undefined
Length: 8min 39sec (519 seconds)
Published: Sun Oct 08 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.