Destructible Vehicle Tutorial - Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone in this tutorial we will create the destructible vehicle the same as the metric demo from the city sample project and we use the control rig to deform the skeletal mesh of the vehicle and in this project we don't use any C plus plus only blueprint in the new project to start you have to go to Andrea engine Marketplace and search for City sample and download this free project CT sample and then create it in the new project and another one is the T sample we call go to repeat game launcher and lines Android engine create a new project those game and third person the project name is CT sample vehicle go to epic game launcher and scroll down add the CT sample vehicle to the project that we just created the T sample vehicle and add to project now we can see that we have this CT Sam probably called project inside and go to the map enable missing plugin these are our vehicle and in this project we don't have the destruction and we have to create the destructible we call now go to file new project and choose game the person director and the project name is destructible vehicle this is the project that we going to create the destructible vehicle it is blueprint project and create first we have to go to plug in and then search for chaos because plugin and enable it search for enhance input if you are using Android engine under 5.1 and restart Auto project setting and go to input default player input class like enhance Flagger input and default input component class select in hand input component click on all setting search for virtual texture and enable this virtual texture support then restart the project again now create a new folder and the folder name is we hit call open it new folder map create a new level the name is we call map open this new map translated then open this CT sample vehicle project and we find the lighting from this light light sauce by pressing Ctrl and select isps Skyline and we'll reflection capture copy it Ctrl C and paste it inside this new map now we have the lighting and select all this floor copy and paste it and then save all to stop this red bonding we have to build the lighting we're lighting only and go to Project setting go to map and mode in the third standard map like the vehicle map and this game default like vehicle map we choose this map because when we open the project and the engine will open this map as the default and then go to CT sample vehicle and the input select it right click and then migrate migrate all this input find our destructible vehicle project and go to content and select folder and you can see this is the input you can create it from scratch if you want but I choose migrate it's faster you just go to import input action and another one is input mapping contact and this one for Loop to rotate around the vehicle and this one is probably called to move the vehicle forward and steering it left or right and you can open this mapping when we click play we spawn this person character but we don't need this so go to the person blueprint and this is the game mode that use for the third person character right click create a new blueprint and create a new game mode name it BP empty game mode open this game mode and this default pound clear it and go to word setting game mode override like the vpmt game mode now when we click Play We Done found any third person character and when you want to move around press f8 right click and you can press W ASD to move around after you download the CT sample project you can find the location of it and then open the project it may take a long time because it is a shoot project so you have to Patient a little bit this is the recommend spec for your PC for this citizen project and we have to migrate some of the assets from this go to recall and go to we can we call 03 click on the animation mesh basic skeleton and then right click micrite this is about this control we don't need this route effect material picture and the vehicle we don't need this effect material texture big call can hero and we call oh and we don't need this material and don't need this check texture because why Niagara P3 importer and traffic and this is what we need click ok and select the destructible vehicle protect location content like folder and you can see this is we call three and this and the mess then in the vehicle click on blueprint and select this tree folder and this track and right click migrate click ok and do the content of the destructible vehicle you can see these three folder but some of the struck not yet migrate yet also like all this track and then right click migrate okay and select folder then this animation right click migrate be done migrate this control route if I material texture effect material texture recall 2 because 3 we call 5 when Niagara V3 traffic we only need this animation and basic click ok it's like folder and some of the folder is the same so we have to click yes all and we have this Ctrl link one more thing that we need is go to wait call and we call can we call three click on this and this da deformable vehicle can be equal three data set right click accept action and then migrate and disable this this ball everything and open this big call enable this above blueprint a bike material texture we call O because when we call 13 and this texture we only migrate this the ad form of Bobby o'clock here because three click ok and select the location like folder and now we have everything that we need so we can close this CT 7.99 project from the city sample project we get this control rate is track and the basic of the can the skeleton the animation blueprint the mess of the vehicle and this is the physics and the skeleton of the vehicle and also this data set blueprint and we create a blueprint class all classes and search for real you have to enable the chaos vehicle to get this wherever you call pound and select the name is BP we call base we create the base from blueprint and then add spring m and add camera to the spring m like on Spring m the M length is 495 and the location C is 140. we disable this inherit role and enable camera lag rotation leg and this is 15 like speed and three and make this 10 is 100 now go to event graph we will create the enhanced input call even or size and another one is even and post size when we process the vehicle has to layer controller get enhance input local player subsystem then call add mapping contact add dry ball the variable name is input mapping and set the variable type search for input mapping contact object reference duplicate this variable by pressing Ctrl d the name is input log mapping and compare the input mapping like I am pH input mapping and this look is imlc input mapping then get input mapping and connect it to mapping contact all another one add mapping contact and yet look my pin Knight to my pink contact this one for control the vehicle and this one for looking around the vehicle and then when we end process as two layer controller called enhance input local subsystem and then remove my pin contact we remove this input mapping and another one remove my paint contact remove this input look mapping this event recall when we get out of the vehicle so we stop controlling the vehicle anymore call all right a SC local time and this action value right the and make Victor Z and this y multiply with minus one and connect it to y is my return we done made the vector we call make rotator and why Y and Z to Z delete this at Spring m add local rotation and call it when we trigger and I told the entire rotation and then that relate to rotation and get the spring m get relative rotation split crack pin for the page reclaim the angle mean is minus 15 mean is minus 50 and the make is 5. so we can look from the bottom of the vehicle or from right up of the vehicle and make a rotator like this to pitch and the jaw to the jaw this year we don't claim the angle so we can look around the hand 360 degree we add IA v h structure get vehicle component movement component and set throttle input trigger and complete action value to throttle I a v h break and vehicle movement component that like input in this vehicle movement component we have everything that we need for the movement of the vehicle like the throttle the brake i a pH and break and vehicle movement component that and break input trigger and ongoing and complete connect this action value I a V8 steering and get we call moment component that daring input feature and ongoing and complete and this action value to steering we have the input for our vehicle right click on BP vehicle base and create child looping class we name it BP vehicle base the form maple and open this we get everything that inherited from this vehicle base there are spring M and Camera let's go to City sample project and you have to scroll down to the vehicle and we call three open this BP we call three sandbox and go to viewport select this skeleton mesh so this brake pad and select the offline destructible SM dollar and SM frame do this SM wheel l we only dance like the audio entry exit and audio copy Ctrl C back to our project and click on the mesh Ctrl V and we get this big call we don't have the material for the texture yet to add the door go to SM dollar front or and go to the mesh this door we drag it to the static mesh click on the mesh and the skeleton mesh we use this skm because 3. this skeleton don't have any mesh on it you can go to character and search for bone and all hierarchy you can see this skeleton when the skeleton deform they will control the control rate and a name class find the animation and use this fbp because 3 animation blueprint and scroll down and done forget to inner body simulate physics skm proxy there's skeleton mesh is this proxy we call can exterior use this skm exterior skm frame destruction use this Frame destruction so go to vehicle movement component and we have to set up this movement component the real set amp let's add four time because we have four wheel two front and two back and select this run for the real class and this is Ria you can see inside this low brain class we have the physics that defines this field there are radius of the wheel the Y the stiffness you can modify this for different type of vehicle and let's open the skm because and this is the bone for the wheel front turn l I'll pay this name and place it inside this bone name for the first wheel another one is we have front and line copy and paste and real for the back here and another one is really all for the back wheel right side and we'll Trace Collision that we call we block the vehicle and engine set up the curve like cause Curve will cause three makes toss is 500 5400 and this I dot RPM is one thousand three hundred engine brake effect is 0.1 and this is 5 and 600. then we set up this transmission automatic reverse that it will fall and this array we delete this this one set to pull 0.82 1.5 1 0.7 and delete this that it to 2.31 0.32 and this gear chain 12.2 and transmission one scroll down steering setup the steering type like egg command and angle ratio is 0.8 and you can go to the example project click on vehicle movement and find the steering the steering curve right click copy this curve and paste inside the steering curve or you can move this point and set the mass to 1850. and enable the center of mass it is 26 and Z is 56 I have to be precise because I want the same behavior as the original project pause control we set this rotation then pin to zero compile go to vehicle map and this blueprint drag it to the scene click on it and go to open the blueprint right click create a reference to my previous deformable make sure that you click on this free card before you can create the reference of it and get player controller called process and process this performable vehicle NATO begin play let's play a test now when we play We possess this we call and we can rotate around this vehicle when we press w IM move forward and can turn left and turn right but the will not yet rotate with the vehicle we have to set up this go to this city sample project and you can find the vehicle and blueprint open this bpv code base deformable to your part and search for nanite mesh copy this function and pass it inside this and we delete this add local offset delete the variable wheel add local offset delete this the remote sampler we don't need it then compile because when we move the skeleton mesh video type so we have to attach the static mesh of our wheel to the skeletal mesh to the bone of the skeletal mesh so we can see the wheel rotate with the skeletal mesh and go to construction script and because this attached 992 skeletal mesh we call it inside the construction script because we this script will run before we play the game let's play test and now when we move the wheel will type but it looks with the rotation go to the animation ABP we call K we call three and use this wheel instead of the stage effect view controller if you use this you have to have the motion blur to make the wheel looks right for the vehicle let's play again now we can see the video type and we can turn and we'll turn you can try the vehicle now in the city sample project for this vehicle 3 sandbox you can see the parent class this parent class is we call by sandbox and then after that we have the pattern of it is we call Base destruction this one is focused on the destruction of the glass after we call and the material the pattern of it is we call base deformable in this tutorial we will focus on this deformable and after that they have the parent is we call Best dryable another pattern is vehicle base and then the pattern of it is citizen public office that is the C plus plus SAS file so we only focus on this deformable that we can control the control to deform this vehicle when it collides with the wall or another vehicle you can go to the construction screen and see there are a lot of function here but some of it is not related to the the formation of the vehicle I will point out which function that related this one said skeleton mesh that Master pose attach nanay to this girl Thomas this one we already copy this function so the formable skeleton mesh this is not useful so let's get a message for you on hit even and another one is store plastic constraint for the event graph we don't need this begin play and the begin take we need all this deformed mention events the control rate this one is very useful the controlled pre-initialize it's connected with the controller with the skeletal mesh and we need this hit mesh we call mess on heat and and the thing is not useful for our project we can create all this function from scratch but I chose to copy the functions so it's easy for us not to confuse to create the destructible vehicle we have to go to the CT sample project first copy this set skeleton mesh I said and then create a sequence and set this skeleton mesh promote this skm proximate to variable compare then use this skm proxy with equal three for the skm proxy Mass search for set master copy and paste it photos construction script and call set master then attach the NATO Delta mesh search for enable controlling copy and set this category to the Palm Apple have photo construction script then search for on body it looked up and strength function I'll pay it and paste this function set it to deformable and promote this deformable variable that I said and promote this constrained body map this deformable we call data set that it to deformable and this constrained body map that it will deformable then copy this storage scale tall mesh by you for on hit event total construction script and paste it rename it by delete the tool and promote this found actor to dry ball deformable body rest transform but they prepare this 10 multiplier but the previous rotation multiplier and instead this to deformable and this one to the formable and this department ball compile and connect it to the store press skeleton mesh value for on hit event after that we copy this store plastic constraint and press it rename delete this number two add pin connect to store plastic constraint a pen promote this plastic constraint and set it to deformable pale plastic constraint the air dry ball and deformable compile close all this function we only need this by function for our construction script go to event graph and we have to initialize the control link by mapping the girl tongue mesh to the controller so go to event graph search for so deformable skeleton mesh and copy this function press it confirm and delete this reset motion blur for all component this Frame because we can use the motion blur for the wheel and then promote this girl Thomas is display and set it to deformable this function set it to deformable category and let's copy this control rate and go to event graph press it and promote this white top three in need control rig this control rate pre-initialize we name it and we open and we can see that we use the deformable we call that asset then get the rig element mapping and add it to the map element of the control link promote this controller map element and set it to deformable and click on cr-frame distract people and choose the control rate go to animation of the vehicle and use this CR frame destructible controller for the deformable we call data set we have to choose the da deformable vehicle three data set and back to even then we have to create this deformation events search for socket that time from rice okay as this function and set it to deformable compile search for ons found static mesh airplane okay as the category name is they form a ball effects and compile search for on basic foreign price basic enable trend a payment paste and then search for on plastic deformation copy and paste this and confirm delete this on we call this aboard because we've done this before this we call and promote can drive vehicle to Bible that the category oh the form a ball fight sorry the category name is interaction close all of this function then search for enable bumper bound check okay press it then that it to deformable category this bumper remote to variable and this bumper layer over eyeball track bumper front survival and drag bumper rear to dry ball that these two deformable compare and go to event graph CT sample project A1 graph we copy this event except this take a regular denture copy and press it here as compared and promote this can interact with driver door passenger door dry ball and go rename is interaction and this one interaction too compile and interact with driver door set it to true and this passenger door say to true found static mesh at bone copy this function guys then we set the category to deformable this bound that it will deformable prayable let's compile and then search for in Nepal basic body below okay as informable and compare search for enable physics for bone okay and press promote this basic join enable to dry ball and set it to deformable and this control rate basic joints mode 32 performable and compile this controlling physic join we have to find it in this variable and we have this name of the array so copy it and paste it inside this array of the control requested join compare then the macros copy this enable chance and paste this macro huh then search for when basic constraint race reset copy press it that take the original deformable and we promote this and swipe back to nanay let's compile that to true we have one error is get broken glass bone promote it to variable and then 32 deformable compound search for the form we call and reset constraint pay this and then press it that into deformable and compare then copy on plastic deformation mesh even go to event graph and press it here then promote enable distract then motor variable and set it to destructible compile then it will true compile again then we group this click C name is deformation even and we change the color to Blue and then copy this everything in this even and copy I'll say and paste it down here let's compile this on hit component is from this mesh you can scroll down and see this even also on plastic deformation is also from this milestone let's close all the functions selected and we can go to the go to the mesh skm proxy go to a set detail inside this asset detail you can see this post process and name blueprint and we use the ABP proxy post we call care but for this this is the animation blueprint open and we have to connect the input post to the Place post go to the scene and add type cool set the scale of eight y and z a bit High level prototyping material use this flow type 3. that's flight test now let's hit this wall and we get the deformation but the line of the vehicle is not bright the glass of it so we have to disable this photo that we call Base deformation like on this glass search for visible that need to fall and when we play tests hit this we see the deformation inside the vehicle we lost don't have some of the static mesh let's find the static mesh that we know that add inside SM frame interior go to recall because range and this interior SM engine this engine SM wheel everything is set up let's play test again we can see the deformation and the back it's working if you press F A and so cancel the bone and this is the bone of the get Thomas when it hit the basic Ascent move this bone and this bone may be the control rate and this control rate will deform the skeletal mesh and you can show State Bar bone and disable this and search for Collision in about this Collision can see all the Collision and this is the Collision when it's hit it move backwards and when it's not hit it stay at the front and this press is the touch from the Delta mesh you can say there is a basic asset Collision this is the Collision of it and you can show the constraint we have all this Collision that used as the sensor to the world to the detect the impact of the vehicle you can duplicate this Ctrl d move it forward latest and when we collide with other vehicle the other vehicle will deform as you can see and now we have to add the we call material to add the vehicle material we have to find our cities and probably call open it then go to we call three and click on material and texture right click migrate disabled is citizen public call this about this asset guideline we it's migrate the material and texture this is about this vehicle tool is about the effect and Speed 3 then click ok export it to the destructible vehicle project and like for the let's close this and we can say there is the material inside the city sample we call and open this Mi folder these are the material and to know which material we can apply go to the city sample project and go to mesh open this skm Collision and asset detail we use way campaign let's close all this open the mesh open this Collision search for pain use this MB campaign and Save open this skm destructible and for the CT sample project we open this destructible and use the same name as this material let's move it side by side we call Row three and copied in this name because we will use it often and have eight number s 15. that well one 15 by 0 15 13 one thing well scroll down this 16. 18 19 20 and 21. and we save all open the next skm exterior this one and that the material well 14 the van Windsor 18 16 and 13. and save all I sell it because sometimes it can crush your engine when you don't sell a lot of stuff so we prepare we have to save it then skm proxy and that the name the same as before 15 well ington 20 7 13 14 16 1 19 3. oh one why oh take windshield hey and Sarah save all and the next one we don't have the material must be done have the mesh for the skeleton mesh and close all of this and open this break this one can close and open display the material let's move it the battery is 17. and another break plantain open this door 16 when 13 1 8 19 and 12. let's save all in the right door 19 18 13 so when 16 well and so when 10 21. inchin 20 and 17. hello interior we call plantain twenty nineteen 16. then frame 15 well 14 16 19 20 and 21. steering 19. and this we call cassery and save all of us there are a lot of material slots so you have to be careful with the order of the number and 11 0 12 7 and 13 boss mess extend 14 18 19. 20 one save all open that makes no wheel s all this static mesh now we continue planting 13 well 15 . 18 7 19 20 and 21. they were all that is real l and 11. real or the same is 10 11. Bill l and 11. build all and 11. and this one is for great material now we set all the material let's save all and we can view our vehicle have the correct material and play test again with this material of the vehicle and hit this vehicle we can see the deformation of the vehicle or this tutorial I spent a lot of time for learning about the topic and talk a lot of trial and error so if you like these tutorials please hit like and please subscribe to my YouTube channel and thank you very much for watching see you in the next tutorial
Info
Channel: jourverse
Views: 23,063
Rating: undefined out of 5
Keywords: UE5, Unreal Engine 5, Destructible Vehicle, The Matrix Awakens, Control Rig, Tutorial, UE5 Control Rig Destructible Vehicle, City Sample Project, City Sample Vehicles, City Sample Tutorial, Destructible Car, Deformable Car, Control Rig Map Element, Control Rig Initialize, Drivable Vehicle, Car Accident Unreal Engine
Id: wnr2AauJjGQ
Channel Id: undefined
Length: 88min 24sec (5304 seconds)
Published: Tue Aug 22 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.