Rig and Drive your first Chaos Vehicle - Unreal Engine 4 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Thanks for the video to confirm that chaos vehicle even works in preview. I was trying to get it to work with the template vehicles but couldn't get it at first.

👍︎︎ 1 👤︎︎ u/ManicD7 📅︎︎ Sep 28 2020 🗫︎ replies

good, i was wondering what chaos vehicles would be without having to install the preview when i first read the release note

👍︎︎ 1 👤︎︎ u/kn00tcn 📅︎︎ Sep 28 2020 🗫︎ replies
Captions
hi everyone so unreal engine 4.26 preview one has just been released and it includes the new kels vehicles so in this tutorial we'd like to show you how to rig a vehicle for it and then import it into unreal and make it driveable through the new cows vehicle plugin here is in blender vehicle which i have already rigged for importing it into kaios as you can see it has bones which are oriented along the y-axis and the car itself is oriented along the x-axis this is very important and in particular in blender you want to set the unit scale to 0.01 so that centimeter you don't need to change centimeters here just put 001 and also make sure that you select everything with a and before exporting you apply rotation and scale this is very important because the skeleton has to come into unreal with a scale of one if not it will not work okay so double check that everything is according to this example and then proceed to exporting so a to select everything file export fbx and now make sure that i have a preset here but make sure that everything is as it looks in my preset in particular you want to export the selected objects then armature and mesh scale has to be at one forward x forward up that up also apply unit that needs to be checked the smoothing has to be face everything else here has to be antiqued except apply modifiers and then for the armature primary bone axis has to be y-axis and secondary bone axis has to be x and make sure that add lift bone bones is unchecked and once you're done with that just export i will not do it because i've already exported it but press the button and go ahead and once it's exported it's time to move to a real engine import it and create the new chaos vehicle so let's start the real engine from the launcher and we can close blenders we don't need it anymore library let's launch 426 zero preview one so once the engine has ordered the games let's do a blanket and then leave everything as the board and we call the project chaos vehicle tutorial create project okay so first thing first among the plugins you want to type chaos and make sure that kills vehicles plugin is enabled and then you will have to restart the engine okay now double let's double check that the plugin is already it's enabled as well as the rest of the chaos stuff okay now uh what we're gonna do is let's remove the player start from the level as we don't need it and then here under content let's create a new folder for our dodge and then add import import game then let's go to blender documents blender and find our car and open okay make sure that it's indeed the scene as a skeletal mesh import mesh and everything should be left default make sure file units here it's centimeter which is fine import all okay once it has done importing you might see a message like this so there's a named clash and body was renamed to body one which is fine no worries now let's have a look at the car which we have imported and in particular you want to go to the skeleton and click on body and verify near scalise 1-1-1 so that's perfect the other thing that you want to do is you want to go to the physics asset and actually remove all the bodies that have been created by default because we'll have to redo it so delete all bodies below okay so once this is done here in the options you want to show all bones and actually character bones bone names and also all the hierarchies and one thing that we want to do is zoom onto bone speed too far but basically we want to make sure that the bone is oriented properly so you will see that the y-axis is toward the right red one forward and up so this is how it should be if you see any other orientation then the wheels are not going to rotate correctly so make sure that anything you do the bone orientation is this one okay now let's go back to physics actually we already in physics and let's create a collision shape for the body of the car so we're going to use the multi-convex hole but here we're going to say all count 1 and press add body and basically we have created a very simple collision body for for this car and then we want to do the same for the wheels so basically select all the wheel bones and then here i'm gonna go to sphere this time and add bodies so we have one sphere per wheel and one collision body for the car now what we want to do is select all these all the collision bodies for the wheels and change their physics type to kinematic you see that here it becomes the icon becomes a little lock so this is what we want for it to work and the rest can stay as it is okay so let's save here also the mesh and the skeleton and here we are good to go okay now back to the folder where the car has been imported we basically want to right click on the dodge charger rt on the skeletal mesh and we want to create an animation blueprint so i'll just leave it with the full name let's open it now want to what we want to do is first thing here is go to class settings and you see that parent class is an instance actually this is not correct we want to switch to vehicle animation instance and this is a bit tricky because they have very similar names but you want to take this one vehicle animation instance this is the one connected to chaos the other one is for the old physx vehicles okay so make sure you switch that and now we are gonna add the wheel handler so you type wheel then scroll to the top you see wheel controllers for wheeled vehicle so this is what we want make it a bit of room connect it the component to local node will appear that's normal and now we're going to fit it also with mesh pose so mesh space or ref pose this is what we want to fit it with now as i compile you'll get a warning and this is normal and basically i believe they have done this because they don't want this uh you know cause vehicles to be used for production yet so uh this node has been marked for editor only it will work but you will not be able to package basically that's fine let's save and close this okay now back to the content let's make a folder for our blueprints and inside this folder we're going to create a new blueprint and here you want to go on all classes and type wheel and you should see wheeled vehicle phone and if you hover over it it says chaos wheeled vehicle so this is what you want to have as the base for your the wheel of waco pawn and let's select and confirm we call it bp chaos dodge let's open it and basically this is made of a skeletal mesh and a vehicle movement component which you hover in on it and it says calls with the common component okay so we are now using the kels version of it now first thing first you want to click on the skeletal mesh and assign our dodge charger right perfect and then for it you want to assign its animation blueprint which is this one here so make sure that this is correctly assigned then as usual we want to add the spring arm to it and attach it to the spring arm we want a camera so this is typical for a phone and now let's let's make sure that the spring arm is right here we give it a bit of twister i think this is good and maybe here on the right we make it a bit we bring it a bit further away okay so this is done for for the moment and the rest basically happens so the configuration happens within the vehicle movement component okay so we have a few options here that we need to set first of all the wheel setups so we're going to click this plus four times because we want you know four wheels and as you open each one of these voices you will see that there are two things that we have to do is indicate the wheel class and indicate the bone name for the wheel now chaos is pointing us to the standard weak class but actually we need to create our own so let's close this for the moment we still go back to the blueprint folder right click blueprint class right will again and you will find chaos vehicle will so that's what we want select and we call it the bp wheel front okay let's duplicate it bp will rear and the reason we need two distinct ones is because we can tweak separately the characteristic of the front wheel and the characteristic of the rear wheels in particular for example whether you know the handbrake is acting only on the rear wheels as well as the engine if you have a rear-wheel drive so that gives us the flexibility that we need actually let's open directly this blueprint and you see here on the right all the parameters for the wheel um let's adjust a bit the radius of the wheel to 35 i know it because i've measured earlier the radius for the for the dodge and then affected by brake that's normal for the front wheels and we want them to also tick affected by steering because these are the front wheels and leave the rest as ease and by the way note here that you have the option to use you know raycast suspension sphere cost or a shape cast so for the moment we're going to leave it to break us but in general you know you can use a better method even though request is the most efficient one so save now let's go back to the rear wheel also the radius to 35 and since this is the real wheel we want it to be affected by the hand brake and by the engine we're going to do a rear-wheel drive okay complete compile uh also note here that you have the option to do use and enable abs and traction control so in this case we'll leave it as this but you know we can come back later to that okay so now back to the blueprint for the car in the vehicle movement component now we are ready to say here will class front and then let's put the bone name in our case it's wheel fl it's front left same here front wheel front right and here we switch the rear wheels so vp will rear we'll rear left will rear right okay so our wheels are properly set up which is good and next we have to set up the engine here you have all the options about the engine the differential so ensure that you know we are on a rear wheel drive and now let's configure the engine curve now this is tricky because there is no default curve which has been provided with the car so we double click here and basically this cur engine curve is normalized vertically between zero and one and horizontally it has to match the rpm so the max rpm of our car is 4500 which basically means i'm gonna add you know right click add key name and make sure this is zero zero so this is the first key and here i'm going to add another key and put set its time to 5000 which is well beyond you know the max rpm and its value also to zero okay then clicking here you see both dots and now we have a curve which goes from zero to 5000 and i can start adding you know some keys to it in order to right click and add key right click and add key right click and add key so let's give it a bit of shape of the engine torque curve oops actually note that the maximum has to be at one well you can go above it in principle it should be like this and basically we have our engine curve now once you are done with this you have to create the external curve basically so you see that here is the depiction of the curve we just created and it's actually linked to this external curve which we just saved also the engine idle rpm it's uh 1200 that's fine so leave everything that sees that should work what we can do is you know because this is heavy car so it's 1500 kilos and it's a sporty car we want to give it a bit more torque so we're going to use 800 for example and now we are done with all the settings and basically we only need to connect the inputs okay so let's get rid of this compile let's go out and then inside the project settings under input we're going to add some axis so number one we're going to add the throttle and let me use the w on the keyboard for the troll then we want to add break and let's use the s on the keyboard for the break plus plenty of assets around keyboard is here good then we want to add the steer [Music] and here we want to use the d to still write and we want to use the a to steer left so we're going to use a minus one and last but not least we're going to add also an action for the handbrake call it handbrake and let's use a space for that which i think is good for the end break so we are done for what concerns than the input axis and actions so close now let's go back to our blueprint and find the throttle and once we have the throttle input event we drag a copy of the vehicle movement component and we say set throttle input so this is what you want to use here then the next one let's use the brake and well same deal set brake input also dragging out of the vehicle movement component then we have the handbrake and actually know that this is slightly different because we need to duplicate it with ctrl w and basically the handbrake input is not an axis but it's a action so when it's pressed we want to hand brake and when it's released we want to release the end brake and both need to be connected to the vehicle movement component and now up here let's add the steering steer to drag out of the you can move a component set steer steering input and connect it all right so this is uh steering throttle brake hand brake or connect and over it okay so let's uh actually take this level and the floor and make it a bit bigger so we can drive around i'm going to use a scale 2020 for x and y we already removed the start of the player so let's track directly the car into the level now make sure that it's a bit above the floor which is fine and then on the right under details auto process player zero save make sure that we save it as a test map for example um actually we should create a folder for that but it's fine to have it also in content and i think we are ready to play maybe we just build the lights because that message is bothering me and let's play and see whether we're able to drive the vehicle and if you see this happening right so see that the vehicle is really not moving nothing happens and the reason is that you need to go back to your blueprints and for your skeletal mesh you need to activate simulate physics make sure also the collision process is too very hot because that's what it's needed and since i we already let's also bring the spring arm a bit further because i think it was too close to the car and now let's and play and let's see whether we can drive our vehicle i'm pressing w d a s to break but also access reverse and finally the end break with space they all seem to work actually we don't see much of the car because it's where we're looking at it from the rear so let's go into our edit project settings input and add two axis one is called look up and we're gonna use the mouse y for that and the other axis is look right and we're gonna use the mouse x for it now we're gonna use this close and we open the blueprint to basically control the spring arm so look right i want to add relative rotation and right click here and split the pin structure and then for the axis we want to connect it to the yo ctrl w duplicate this node bring in the other input which was look up connect it to here execution and this axis value finally we want to connect it to pitch so now this allows us to rotate the spring arm so we can look also from to the car from the side make sure it drives properly and see what the wheels are doing so play once more you go you see the wheels turning and then we can drive handbrake you see that it's blocking the rear wheels which is fine reverse okay now you see a problem and actually i don't know why this happened seems like a bug but basically when i'm reversing the rear wheel is rotating the wrong way so to fix that we go into the bp well front and we thick with check affected by engine will still be a rear wheel drive but for some reasons that solves the back let's check forward is good break oops no that didn't do it which is interesting enough and let's go back to here yeah that's a rear wheel drive next actually use the overdrive and see whether that fixes it forward yeah so it seems that if it's a all wheel drive it's fixing it but otherwise it's turning the wrong direction it's rotating the wrong direction also i think this car you know needs a bit more friction so i'm going to open both of those and here where it says lateral friction force multiple sorry longitudinal friction force multiplier let's give it a three because we have you know very sticky tires and since we already let's make the suspension a little stiffer by under 300 here and i'm gonna do the same here so i think we use the four or three i forgot these are the rear tires so it's fine to have a bit more grip and 300 there's another thing that i don't like let's see how if it drives a bit better yeah i think that's good see that we're also sliding now what i don't like is this motion blur which you might or might not see in the recording so i would like to go to edit project settings motion blur and turn it off altogether yeah and that makes it for a i think it makes it for a nicer look and feel all right that's pretty much it i hope you enjoyed and wish you a lot of fun with the chaos vehicles
Info
Channel: Marco Ghislanzoni
Views: 48,789
Rating: undefined out of 5
Keywords:
Id: GcsVkmlpVTw
Channel Id: undefined
Length: 28min 14sec (1694 seconds)
Published: Sun Sep 27 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.