WHEEL SUSPENSION FOR CAR CINEMATIC RIG | Unreal Engine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
always wondered how to make suspension for your car rig in Unreal Engine which will respond to every bump on the road and uneven terrain but couldn't find a solution for it well today we're going to fix it and you won't believe me but solution was right before your eyes I will tell you where it was located inside the Unreal Engine in the end of this video hi there post process is here and welcome back to my car rigon series recently I got a lot of new followers so for those of you who are there for the first time or recently joined I'm and real engine artist working in postproduction company where I'm focused mostly on Automotive CGI and animations as I mentioned in my previous tutorials animating cars with chaos vehicle plug-in may be fun but it's destructive approach which requires you to redo animations from scratch if you do any changes leaves you with a bunch of short takes and generally is pain to use in production pipeline especially when client asks for changes I have shared with you my Approach for animating cars in unreal attention to L animating drifting and so on in today's video I have prepared something special for you a working procedural wheel suspension which you can use for your skeletal car mesh as an addition to my car rig which I shared for you in previous tutorials few notes before we start first of all use Unreal Engine 5.3 as in previous versions there were some issues with the wheel rotation and it's better to use 5.3 at this point make sure to watch my previous rigging videos by clicking here or following the link in the description there I have explained how to import car model and prepare for animation as in this tutorial I'll be working on control rig blueprint which I have already made I really insist you watch this video before we continue if you haven't watched it yet now let's get started make sure that you have all running so we can start assembling wheel suspension script as I said here I'm using control rig for Ford Mustang I've made earlier all controls are working and that's how the blueprint structure looks like now let's create Logics for the suspension first navigate to my blueprint tab here we can create variables for each wheel rare left rare right front left and front right first I will create variable for Target distance I will name it Z offset RL Target for rare left wheel now I copy and paste this variable set variable type to float now I will rename variables for each wheel accordingly this variable will dictate how far our wheel goes when it hits something later we will interpolate this value for smooth input now I'm creating variables for each will which will be used for transform input I will name it Z offset and will bone name I also need four of them and we name them accordingly okay we've set all the variables and now we will create the wheel Trace function click here on plus button to add a new function name it wheel Trace so here we have entry and return we need to add input and output arguments so for entry we will feed will bone I will change its type to rig key element and for output we need a value which will be a [Music] vector now right click on empty field and search for get transform this will add transform node connect argument pin to item we'll be able to choose which bone we feed to this transform outside of wheel Trace function this will make our rig look clean now drag root bone to the blueprint field select get bone expand transform pin from the first transform node drag translation pin and look for add node from root transform bone do the same but look for subtract node after that unfold pins next connect Z from root bone both to add and subtract nodes into Z axis of a tab do the same for X and Y AIS for first transform node and connect it to a tab of add and subtract nodes this will will give us a position of each wheel relative to the scene route where tracing will be happening for each wheel now in B tab Define Z value in add node it is 10 and in subtract node it is 30 it will give us a limit of how far tracing should be happening basically start and end of it if you have different car model maybe if it's SUV or something like that play around with those values to Define how far your will can go inside of the body or drop down now right click on an empty field and look for sphere Trace by object types node add object type World static and World Dynamic by clicking on plus button connect add and subtract results to start and end pins of sphere Trace now we need to figure out the radius of the sphere Trace that should be the radius of the wheel of your current centimeters to find this value just drag and drop your skeletal MH into the scene switch view to left or right side Zoom to your car's wheel and by holding middle mount button drag a line from one side of the wheel to another it gives us roughly 70 CM so I will use this value navigate back to your control rig set radius to 70 unfold hit location pin Peck Z value and connect it to return this is it we have made the wheel Trace function and now we will receive heat inputs from our Wheels we need to use use these inputs in order to transform wheel movement go back to forward solve script basically our main Rec controls here from my blueprint tab drag function you have created as we made an argument in this function we can now select the bone and add any bone for tracing you can use wheel bone or caliper bone in my case first wheel is rare left but I will use caliper bone it doesn't actually matter which bone will you use caliper or wheel bone but I prefer using different bone from the one I will be applying changes to but feel free to use the wheel bone for that too so I pick caliper rare left bone first unfold value pin and drag offset Target for rare left wheel to the blueprint select set offset Target connect it with wheel Trace function and connect that value to offset value input repeat this for all four wheels rare right front left front right don't forget to select corresponding bone in whe Trace function connect this function from sequence or from forward solve executable [Music] node you can add more pins in sequence node by clicking on plus button good right now we have heat detection for each wheel and this information will be stored in our variables now let's interpolate those values and apply to our Wheels drag all of your target variables to blueprint and select get value next right click on empty field and look for Alpha inter turp node connect value pin from Target variable to Value pin of alpha interpolation next drag offset variable of the same wheel and connect result of alpha interpolate to offset variable do that for all four wheels and set interpolation speed to 20 the higher the value the faster interpolation happens I found 20 to work good but you can play around with those values to get desired [Music] result connect forward solve or sequence to enable those nodes do not forget to enable interpolate result checkbox otherwise wheels will not react smoothly due to rain okay we're almost done now let's apply those interpolated values to transform our wheel bones here I have wheel rotation and we will be adding offset for our Wheels here if you add it before or after those nodes it will make your wheels rotate in very strange way drag your offset variables corresponding to the wheel you will be applying it to select get offset connect this value to Z AIS of the wheel do that for all four wheels now let's make the same with the caliper bones they should be affected by bombs too right I will just copy offset transforms change which Bones they should affect copy get offset variables and connect them to Z values of desired break caliper [Music] hit compile and save this is it let's check it out here I have default setup I have shown in my previous videos on how to animate car by attaching it to this planine you can always check it out by the link in description as you can see wheels are driving over bumps and you don't need to animate them manually it works perfectly well but don't you dare finish watching this video right now because we are not done yet even though it works in sequencer and all looks good Unreal Engine doesn't recognize control rigs in simulation mode that means in your renders it will not work and wheels will remain indifferent to terrain and bumps how to deal with that well I don't know yet just kidding obviously I know how to do that otherwise I won't be making this video leave a comment if I cut you solution for that is actor blueprint open content browser right click and select blueprint class select actor blueprint name it somehow I will name mine BP Mustang open blueprint and click on ADD button pick skeletal mesh then click add button again and look for control rig select skeletal mesh navigate to details Tab and in skeletal mesh asset pick your car now select control rig and in control rig class select the rig we have just created Mustang suspension in my case hit compile and save scroll down in details tab of control rig and look for events click on plus button on pre- initialize drag execution pin of pre- initialize and look for add mapped skeletal mesh node connect component to Target next drag skeletal mesh from blueprint components and connect it to skeletal mesh component finin hit compile and save now if you drag your blueprint into the scene create new level sequence add Rail and blueprint to sequence you will instantly see that upon adding your blueprint you will have animation tab open all R controls become visible you can control your car taching your blueprint rail will make it snap to it and follow the spline right now I'm making a simple animation of moving car forward on the spline and as you can see when a car is driving over rocks all suspension works great yes you still need to animate body manually but it's not as hard as you think and I believe when it's scripted it will look kind of synthetic so I prefer animating body shake myself look at that how simple it is to do pick body controller enable key framing on any changes set the start position key frame for body and now just move across timeline and adjust body shake manually when front wheel goes up means the body front should also go up when wheel goes down but also goes down on that side it took me a couple of minutes and result looks pretty cool obviously exaggerated but still it works and this approach is non destructive if client asks for changes it can be easily done simply by changing spline curve speed of the car in the scene or adjust key frames for body and no headache dealing with the wheel suspension as it will work automatically now when I figure out how to make procedural body suspension for skeletal mesh I will release the new video but I was successful using this approach in the beginning of my career in car animation in unreal and it was very useful and comfortable I know there are a lot of plugins right now available on Marketplace like rush hour irune and so on which utilize same destructive approach of using take recorder and Chaos vehicle mesh and collecting all of the downsides of using it that makes it practically impossible to adopt for production pipeline this solution I have provided you is free to use and it will give you a nice head start getting into Automotive in un real engine also don't forget to subscribe to my channel for more Onre engine and post- production videos thanks for watching and see you in the next one oh yeah yeah yeah yeah I've got the suspension Logic for the wheels from third person character blueprint that's why I said that literally solution was always inside the engine it was only the matter of understanding how to apply ik rig from third person character available in unreal content to the car that's it just keep looking maybe you will figure out how to make the body procedural suspension for the skeletal mesh sometimes the solution just right on the palm of your hand cheers
Info
Channel: Post Processed
Views: 17,235
Rating: undefined out of 5
Keywords: unreal engine 5, unreal engine 5.2, unreal engine 5 short film, unreal engine 5 matrix, unreal engine 5 demo, car crash test, unreal engine short film, car animation, Unreal car, unreal car animation, car rig, unreal car rig, production pipeline, post processed, unreal engine animation, vehicle animation, unreal engine cinematic, car cinematic, unreal engine car render, path tracing, lumen render, how to animate cars, car animation in unreal
Id: r4ebm0XCkhg
Channel Id: undefined
Length: 16min 35sec (995 seconds)
Published: Thu Oct 19 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.