Tutorial: Exporting Animated Cars to Unreal 5 // Launch Control

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
there are so many videos out there about how to take characters and put them inside on religion making the vitamin inside on real engine even put cars inside Unreal Engine but it feels like nobody really knows how to animate a car and put that inside on religion and it's actually rather simple so we'll be using launch control inside blender to animate a car and then we'll export that animation to Unreal Engine we will be going over all the different steps and all the best practices and stuff you would need to know on the other hand if you just want a concise step-by-step guide I've also made this other video that you can use later on as a little handbook but hey without further Ado let's just go get ourselves a cup of coffee and then get started so hey the first thing you can do is to go ahead and find some sort of model that you would like to animate it doesn't matter which one you grab we should be able to rig any car with launch control for this animation we will just use a preset animation inside launch control where you could tweak it or you can make your own however you want just make sure that it looks cool okay so the first step will be to prepare our model inside blender so I have this model prepared with some materials so you can see if I open up my view layer here and jump into the materials you can see I have these named car paint red car paint black tire and tire size and so on and so forth this is going to help us a lot inside Unreal Engine when we're gonna find out which materials go where so if you want to check just all your materials in the file you can go to blender file and then you can extend this one materials and you can see how I have 19 here so if you would have 100 or something like that that would first of all give you quite bad performance and it would also just be a mess having to set all that up so I prefer keeping it as simple as possible when importing to Unreal Engine another thing we would have to do is to go ahead and make sure that we have all the scales one one so that means that if anything here has a scale something like this that would be quite bad especially oftentimes you see that the body has some sort of weird scale let me just go through here and check these different objects it doesn't look like anything has a wrong scale this one here has a non-applied rotation which might also cause problems especially this one here if if I clear out the rotation you can see how suddenly this guy is all the way down here so the best thing to do is to select all your objects hit Ctrl a and then apply rotation and let's hit Ctrl a again and apply scale now we should have all the scales applied and all the rotations applied and actually let's just apply it on this one too so we're sure we don't have any issues it will look a little bit bad inside blender but let me just scale this one down so we still have this one as a handle and you can see how this is ready to be rigged with launch control so now what you would need to do is just make sure that you don't have any flip normals so there are a few different ways to check that one thing you can do is to go in here and that's the best way I would say is to viewport overlays and then face orientation and you can see here that everything is blue that means that all our normals are correct if anything is red let's say this one here would um actually let me turn this off this one here is red you can see that's really bad this one has a flip normal so you would go into you'd select it go into edit mode and then hit alt n and flip to flip the normals you can see here we do actually see into the car here in some areas this is something that would be really good to go ahead and close all these holes let me just turn on my wireframe so you can see better here so going here and then select all these loops and maybe just maybe a little duplicate and then separate this guy with P I can see we have these holes here and let's just fill them and then we can give this one just a black Shader so I have one here it's called Black and you can even make a Shader that is Pitch Black maybe call it black box or empty or something like that just make it animation with zero then it will be unlit you can go ahead and do that all the way around the car as much as you would you would want to if you see any issues inside unreal you probably couldn't guess that it's because of of your mesh having holes and that makes it look kind of funky and with all that we are ready to to go the next step which is to combine shaders so the thing you could do is to select the body of the car or let's say maybe this black piece here in the front and see this one's called carbon let me get another one carbon okay for instance these two are two different objects but they used to assume the same shaders so we might as well do the same materials you might as well combine them so what you can do is select one of them and hit shift L then select linked um and now you can combine these two because it doesn't really matter it's the same material and they all move together anyway the only thing you have to be careful about is not combining any part of the wheel together with the body of the car so for instance these two parts here the headlight and the wheel should of course be separated if you combine them then the wheel wouldn't spin correctly anymore so keep that in mind but anything else you can basically combine so what I like to do is to go in here and just hide the wheels there we go and then you can go in here and see okay glass let's combine all these the red paint let's combine all these there were nothing to join uh the black ones let's combine all this and here again you will just have to make sure that you don't have any modifiers because that will mess up your modifiers if you start to combine stuff so we can go in here and then convert to mesh quickly that will just make sure that all our modifiers are applied and then we can join all this stuff and again here we have a modifier let's go in here and convert mesh and I think we already did come merge this one or combine that one and again we have a modifier and so on and so forth and you can just go through and do that with all your meshes and then we are ready to set it up for unreal so now we have everything prepared and you can see we have a total of 51 objects where one of them is a an empty so that doesn't really count so that's a really good number for unreal and not so many objects and not too much of a mess inside unreal um and the same way we have one material per object and when we have um and we have combined all the meshes into one object that use the same material so the next thing we can do is to open up launch control and regular car so this one is already prepared and if you have a card that's not prepared you can quickly prepare it with the quick attack tool to select the body which holds all the body parts and click body the front left wheel and click front left wheel and so on and so forth and you can quite quickly just link this up rewrite and rear left that's perfect so now we can click red vehicle and we have our little preview animation here running let me just turn off the relationship lines there's something wrong I accidentally combined this one which I should not have done so let me separate this and if you ever need of re-parenting stuff actually a good way to do that is to go into the manual gearbox and into rig setup at the very bottom and just hit rig setup mode because now the car will jump into a rig state where it would disable all the animations you can see no matter where I go on the timeline the car will stay here and if I have some crazy animation setups some drifting all this stuff it doesn't matter all that will be disabled along with the physics as long as you just click the rig setup mode so this is a good place for fixing any issues or any misalignments so let me just check here again yes this is definitely not linked up so let me parent this one to the tire and now I should be able to move the wheel and everything moves along accordingly so that's great so let's put this back and you see our little drift is in here again let me cancel that out and now let's go ahead and pick a preset that we want to use inside Unreal Engine so I want to use this turn to just because I think that could fit well with this Ferrari on a racetrack and this is essentially what we want to import into Unreal Engine so we have a few different ways of doing this in the new version of launch control so one thing we can do is to export with the default settings that will give us one fbx file which holds the car with the Armature and all the meshes including the animation since include animations is checked that means we have one fbx which is very easy to work with but on the other hand if you need to change the animation later you would have to export the entire car again so a better approach for these things is to export the car once as a skeletal mesh and then just simply export extra animation softwares because then you can always adjust your animation and re-upload the animation and it will read very fast inside Unreal Engine compared to if you need to import the car every time so let's go ahead and do that now so we will not include animations this means we will export the car without the animations so just the meshes and the Armature I'm just going to export it next to our our file so that means slash just means relative and let me call this one Ferrari sorry Rick to UE version one and let's hit fbx for unreal and you will see if I do this and my playhead is not at zero it will ask me to put it back at zero so let's just pull that pull it back to zero and then click fbx for unreal it will give you a little message pop up but I skipped ahead a little bit because it can take a little time since this is three million polygons and all that has to be converted into an fbx but now with our car and Rick exported we can export the animation so what you'll need to do is to set up your animation you set up you check that it just looks fine in here actually let's just apply some quick physics to make it look a little bit better and let me get rid of this Grit so let's go in here and probably take race car and then apply physics and let's see here we can maybe feel a little bit with post physics I guess we wouldn't have too much role in a car like this but that looks cool so now let's go ahead and Export this animation so let's hear in the end right underscore NM and then for one because it's the first animation we're exporting and let's say include animations and only animations so this here we'll again export much faster so if I click export it again asks me to put the current frame back to zero the playhead back to zero so let's do that and when I click you'll be able to see how fast it exports now compared to before before it took around two minutes to export everything but this time it shouldn't take more than 15 seconds or so to prepare that and Export it and there we go now we have the animation exported so now let's open up a project inside Android engine and just while Unreal Engine is starting we can go ahead and Export any ground meshes or any other stuff that we want to use inside on religion as well so you could also include this in the fbx export include run the section if you check this box then a blender will take whatever is inside drone detection and Export that and it will also take if you add any extra objects and you place them inside the export objects collection it would export these to the fbx as well but again I kind of like to keep it a little cleaner so you have separate fbx files and not a lot of stuff in one file so let's just go ahead here and Export a completely normal fbx file with this ground detection here we wrote version one in case we need more versions in the future and let's click selected objects let's just untick bake animation and Export FTX there we go so now we just wait for unreal to start so now we have it unreal open with a default level opened up let me just go ahead here and locate our file you can see how we have our three fbxs here so let's drop in the first one being the rig so that was this one I could also have called it underscore rig that would have been more beautiful name and when we drag that in we have to click first of all that it's a skeletal mesh and just leave everything else at default let's go down here and say on the material create new materials we will replace these later with some Automotive materials but let's just for now create some materials so we have it in there import all and after a little bit of time you should see that it starts to import your fbx mesh a few notes Here is that a skeletal mesh inside Unreal Engine is only really working when you have a mesh that has a maximum of maybe 5 million polygons or something like that if you have more than that it's simply not gonna work in case you need to input something with a lot of geometry that just simply crashes unreal then there is a workflow where you can import a basic proxy mesh from blender with launch control and then afterwards hook up your static meshes which are exported just like normal fbx static meshes but that workflow is a little bit too much to go over in this video but it is possible but using skeletal meshes and then just limiting the amount of polygons is by far a better and faster approach good thing is that this we would only have to do once since we are not importing the mesh and rig every time the only thing we will be updating or importing later on is different animations and we can update the animation iterate and even add new animations as many as we want and import that much much faster than what you see here but in the meantime let's just open up the marketplace and let's check out the automotive material pack and search for automotive and let's just add this one to our project okay so now it finally finished importing and you can see we have some error messages here but I think that's okay let us go in here and just make a nice little folder Ferrari everything except this move here and there we go so in here we have our skeletal mesh we have a physics assets and we have a skeleton now we can go ahead and import the animation that loads super fast because that is only 18 megabytes of data so let's go in here and it already figured out that we have this Ferrari skeleton that would fit this animation so that's perfect animation length exported time yeah all this just looks fine at default let's hit import and you'll be able to see that we very fast can import these animations and that's it we already have it imported and we can drag this into the scene and we can check out our animation right away yeah you should be able to see here that our car is doing the little turn as it's supposed to do so now let's import the road so let's go to exports again and just drop in our road mesh and this one will be a static mesh so just don't check skeletal mesh and we don't have any animations or anything like that create new materials that sounds okay let's click import and again this is super fast because it's not a skeletal mesh so let's drop in this static mesh this is zero the transforms and take our car animation also zero out the transforms on this one now these two should match up and we'll be able to see that if we play back or if we just pull the offset here initial position offset then our car is going around the track like in blender so that is perfect we have the shadow in here and everything so I just loaded in this little pack of Automotive materials and that's what we will use to shape the car so we can go in here explosive materials and we can check out which sort of materials we have here we have exterior and interior and these are just really nice materials that work in most cases so let's go maybe find a car paint first that's a good place to start actually this red carbon right here the Mi is for material instance so that's exactly what we what we want so let's just drop this one in there everything and then maybe for the roof that's the black car paint let's use charcoal black it's great and now we would need some brake rotor let's see here we might have an issue because I didn't set up the UV Maps properly let's try this one ceramic yeah that looks like it's working okay it's working decently fine I sell some glass we have with refraction I guess we do not need refraction for this let's just do a tinted glass and plop that in there and then probably for the headlights let's see if we have a specific one for headlights lights oh we do okay transparent cover that's probably good so let's do transparent cover for the lights glass okay and now we need some tires as well it's rubber I suppose the top we have tire so that would be a rubber shiny sidewall let's try the rough and then maybe a shiny sidewall if this works so if we should do also a rough sidewall yeah here the UV map doesn't really work as you can see how it looks a little bit funky but that's something I could could fix of course and see this has the black car paint okay that's pretty interesting but I guess that works let's add some carbon as well carbon fiber and we have uncoated and coated we should definitely use the coat it here see where's our carbon it's there okay let's drop that in there and now for our red inner glass hmm interesting do we have some red glass we have red tinted glass all right red light red lamp and let's try here glossy steel we should probably be able to find some metal in here metal some steel to metal and for the black we need some black plastic so let's go in here and find plastic let's try just a clean black bike bike so and I think that's about it so we have the logos here we could add but I don't know if it will do that for now but you can see how we have a car that already looks much much better inside here and this was literally just dropping in materials not even caring so much about all the details uh but it already looks pretty good with all the default settings so I was playing around this scene a little bit more so just a few extra things to keep in mind when you are working with launch control animations a problem I was facing was that the car kept disappearing or the shading kept turning down to some sort of low quality shading like here for instance it just looks very ugly and very weird so it turns out that this is because the origin of the skeletal mesh is all the way over here and then unreal tries to optimize whenever that Origins out of the views and what you could do for this particular object is to selected so for bounce and then just increase the bound scale to something very high please do not do this for any object because that would give you a super bad performance but in this case you might want to do it because the car would always need to be rendered properly one other thing I do want to show you is that you can go in here to the Cinematic to the sequence level sequence editor and add a level sequence so what you can do in this level sequence editor is basically just take your car or take any object and drop it in here and let's say for the car that you have dropped in here you can click add track animation and then add your animation sequence here and I will be able to see how you can offset the animation and when you play back you will see your car moving and you can link up a camera you can find it you can set up a camera go in here jump into the camera actor and you can sort of see here here I put in a little extra object just to hide some stuff and you can start moving stuff around and make a little sequence with your car running around the track here if you want to and as mentioned you can always go back and just update your animation sequence and right click here and say re-import with new file and then you can import whatever other fbx animation you want just make sure that it's the same car so you can use the same skeletal mesh because if the wheelbase changes or if the mesh changes then of course the animation wouldn't really work anymore
Info
Channel: Daniel Vesterbaek
Views: 33,298
Rating: undefined out of 5
Keywords: Unreal Engine 5, Car animations in UE5, Importing cars into Unreal Engine, Unreal Engine 5 tutorial, Animated cars in games, Unreal Engine car models, Realistic car animations, Game design and development, Unreal Engine 5 tips and tricks, Unreal Engine car physics, Unreal Engine vehicle animations, Unreal Engine optimization, Blender 3D, Importing Blender models into Unreal Engine 5, Blender to Unreal Engine pipeline
Id: bhzgty-JsYg
Channel Id: undefined
Length: 20min 19sec (1219 seconds)
Published: Mon Jun 12 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.