Easy Suspension - Unity Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Issue is MP synchronization mostly. I bet Nelson can easily make physics that work well, but it's the MP.

๐Ÿ‘๏ธŽ︎ 22 ๐Ÿ‘ค๏ธŽ︎ u/Vilespring ๐Ÿ“…๏ธŽ︎ May 28 2017 ๐Ÿ—ซ︎ replies
๐Ÿ‘๏ธŽ︎ 9 ๐Ÿ‘ค๏ธŽ︎ u/[deleted] ๐Ÿ“…๏ธŽ︎ May 29 2017 ๐Ÿ—ซ︎ replies

email him this link

๐Ÿ‘๏ธŽ︎ 5 ๐Ÿ‘ค๏ธŽ︎ u/somerandomguy32432r ๐Ÿ“…๏ธŽ︎ May 29 2017 ๐Ÿ—ซ︎ replies

This doesn't have much to do with Unturned itself, but I'll leave it up because the discussion from the video could be really good.

๐Ÿ‘๏ธŽ︎ 1 ๐Ÿ‘ค๏ธŽ︎ u/TheWiseMountain ๐Ÿ“…๏ธŽ︎ May 29 2017 ๐Ÿ—ซ︎ replies
Captions
hello my fellow gangsters so this will be how to make suspension for a car and first just like don't even do this part but just just watch so Norton so don't do this part but normally you would go like create a 3d object cube and then you'd be like right click that my children create empty and so the cube you would give that a add component physics rigidbody and then the child that would be like the wheel you would be like and like put it where a wheel would be you'd go add component physics wheel collider and wheel colliders have like all these settings and it's like the worst thing in the world and nobody knows how to set them up right but if the parent is the rigidbody now it's got this like real thing and yeah don't do this part because it's just a waste of time and like they never work but duplicate that so then you would have like these wheels you'd like make your car what do I got to do I got make a giant 3d cube here so that we have some ground okay so normally you would like do this and then it's going to act like a complete piece of craft and like go flying into the sky because and then so then on the rigid bar you would make it weigh like a thousand mass instead of one then it would be hitting a little bit better but it's still going to be kind of a piece of crop and it's like really hard to make a car just got like some suspension and then on each of those wheels you would like to set all these things try to make it behave properly but it will always behave like crap and then you would apply your script you would apply torque to it which would spin the wheels and like make it move and everything but it'll just never work as complete garbage don't even try so I found this thing on the Internet if somebody made I will put a there's a link below yeah so this guy Anthony yak hablas has this ez suspension wheel Collider thing you can click this link and just download it there's just easy suspension so download that so I got this easy suspension so extract all like unzip that and he has made a project so the assets and everything so now open unity and just open that project that he already started so open easy suspension easy suspension and yes we import everything alright so he's got a playground scene so open that and he's got like some test car here where so it's a car with much wheels and he has the script on it and this rear wheel drive script makes it so that when you press the arrow key to applying torque to the wheels and you can like drive around and all these things so let's just let's create a folder and just call it what is the easy suspension and let's just move all his stuff in there just to kind of organize this and let's create the folder called scenes and let's go file save seeing as whatever scene 0 1 inside scene and delete this car root so inside of his code he has an editor folder this boxy car wizard and that has a menu item vehicles box the car wizard so to use his scripts that kind of generates a car fries go to vehicles etat box the car wizard and so this thing is like your settings can make a car the axle step is like how long it is so if that was a bigger number you got like me click generate you got like a really long car it's like a limo or something and it was like wide axle width and it's like some weird fat shaped car so for the car that we're going to do let's have the axle step 1.75 and the width 1.5 and just leave everything else generate that let's delete any other cars so we've got this like square shaped car and it's automatically got a bunch of wheels on it already set up and he has made it so that everything just already kind of works so if you press play you know has kind of like a nice suspension already and then he has this easy suspension script with these sliders you can drag so it's like making it a suspension tall or whatever and that is going into every single one of these wheel Kleiner's and making all these numbers change let it doesn't break too badly you can just kind of set it to something so what I found I liked was natural frequency of seven so it's like a little bit of like a little bit lifted a little bit of suspension and then on his rear wheel drive thing that's what makes the arrow keys work so you're like adding torque to it I like to have the torque at like 900 here and then it kind of handle this nicely so see if I double click that it's got some stuff to drive over I've got like a lot of power in the rear wheels which is kind of fun so yeah that's a lot better than trying to actually build this yourself and what it has in this cube this box Collider that's kind of what the weight distribution is for the tires so you always want to keep that I'm going to sculpt I'm going to put a link below for this other thing my buddy toy they made a a car so I'm going to go window asset store and so search for kiddie games and this Aaron's assets so this car was made by my buddy toy a toy at dinner and calm yo toy yay and so download that it's free and I'll put a link below in case for some reason it like doesn't show up when you search for it but so download this package then we'll use that for the art for a car close this tab alright so now we have this like he be games folder yo Aaron's asset and then prefabs so let's take this play car version one drag it into here so now it's like inside of our our car I'm going to move it down to like minus point nine so it kind of fits some big wheels a minute so on each one of these if you select all of the wheels you can hold shift and select the top one and then the bottom to select all of them they have a radius that we can adjust so I think like 0.35 is probably good and then on our cube we have to keep the box collider because that's the weight distribution and without it the tires are just going to break so you just uncheck the mesh renderer so that we can't see it and back on if you select the car route on his rear wheel drive script there's a wheel shape so let's drag his the toy car tire onto that and so when we play the game that is going to like paste the tires onto the wheels so press play we got like pretty sweet-looking car so the Leos move all nice looks a lot cool and everything now off-road style yo just a cool car but so one problem if you look at the wheels on the left side they're backwards right so if I look at this guy like inside out kind of slow on his scale here that was like Linus one then it would look correct right so we need to change the left side wheels so that they're scale X is minus one for it to look properly but we can't change them because they don't exist until you press play right because this rear-wheel drive script that's actually like placing them in so we're going to have to like go into this rear-wheel drive script and like make it our female dog make it do what you want so double click that script all right so if you look at this script that he has it goes wheels equals get components and children wheel Collider so what that's doing is we're right here and we're going to look at all the children which are these and it's finding every single one that has a wheel Collider it's like making a list of them and then if we attach the wheel shape but it's attaching that wheel safely so right here it has W s equals game object instantiate wheel shape it's taking that game object that we have of the art of the tire and it's instantiating it so it's like pasting a net and then it's studying its parent to the real transform so the the wheels transform becomes the transform of that so it's like putting it inside of it so so if we were to go in here and it's likely three Tweel and we're just going to go like so like print wheel dot game then you'll see when you when you run the game so that's actually going through each one of these so let's wait for it to compile then press play and the console window should have the name a zero one either are a 1l whatever it looks like going through each one of these game objects and it's pasting this art inside of it so what we need to do is figure out which ones are on the left side so if we look at the wheels this one's exposition is minus 0.75 then on the right it's plus 0.75 minus 10 five plus so instead of real names go real the transform local position dot tex then we can check this value so after compiles press play so it's minus 75 or minus 0.75 plus you can see it's like on the left side or the right side if you don't have this window it's just window console or window yeah window console right here I thought window doesn't exist for you because it might not all right so then we would just feel like all right so if this thing is less than zero then it must be a left-side wheel so if that WS dot transform local scale equals mu X 3 3 that's an X line z position so it would be WS dot transform down local scale dot X and then comma same thing dot y and then comma same thing dot Z except you want to flip the X so multiply that 1 by minus 1 F yeah so that is going to set so let's save that that is going to set this scale right here to X Y so it's just going to be like whatever it already is x minus 1 so it's going to make it negative and then these ones won't change so if it's on the left side we're going to multiply its x scale by negative number and flip it so now our dope little car I can turn around the wheels still good facing the other side yeah BAM take that wheel wait that's the right side left side wheel woo I'm a wheel it's a pretty cool suspension yo yeah it's a cool little car so now the wheels look good and I'm just going to throw a camera here so ask that import package cameras if you don't have that it means like when you install unity you have to check standard assets and like install those too you can just go to unity website if you don't have it and find the standard assets and like install them but you can import their extend assets cameras and then we got the standard assets folder here cameras prefabs multi-purpose camera rig so I'll drag that in and then they have like a target so I'm going to put car route on there and press play and we should also delete the original camera so let's delete that guy and also I'm just going to make the camera like minus one or something yeah so minus 1y inside the batman camera just to its lower down you don't have to do that but i like that yeah now you got like a cool little suspension for a little car and you could always let go play with the wheel colliders and change all their little settings but for the most part it's very difficult to actually do anything with them and don't forget to save your scene that it might as well create a folder cult freestyle and just drag your car route into there so now we could whenever you want just like in a new scene or whatever we can drag another car in now they're both using the same control but anyway now you can just drag a car in now we got like a pull a little car with like suspension and stuff that's awesome and yeah you could go back into the wheel colliders and just play with all their settings and we try to make they could behave differently if you want you would want to uncheck the seasons easy suspension because that's going to keep changing the settings on the wheels if you do start changing them but uh good luck understanding this stuff that's why the easy suspension thing is awesome and yeah on the next tutorial I'm going to do paint colors because I found like someone made a cool color picker tool so do that next piece so my fellow gangsters buy my game Givi cart yo by car to be card to be card hey this is my ideas some are channel right now marijuana on the stock exchange that stock symbols we that's my favorite stock I'd like to give a shout out to some of my patreon subscribers Stephen sob glass Michael washing dead various desires limited like Co Rodriguez Todd house here sure yeah Stephen Brandon Reza knows the altar Drake Daniel Alexander thank you for supporting me on patreon if it wasn't for you I was commit seppuku okay would have gone to the key where that means every single day I'm heading off to my dream and IKEA never games and I damn well please I don't give a damn Walden's in the pages of running come to only one that really wanted this company only woman's really Charlotte copies being honest I'm assuming everything I promise I wanted notice that I'm a bigot is another thing I don't have the funnest and I know I'm not the largest but I promise you the Hama be the one that work the hardest is I promise you the house be started and I promise you Runa Matilda King summer so I'm here trying to give me cottage now I'm the one who can't read carded get the party started yeah get the party started Jeff let me get a bunny [Music]
Info
Channel: Aaron Hibberd
Views: 113,338
Rating: undefined out of 5
Keywords: unity, unity tutorial, suspension, car, free, easy suspension, wheel, wheel collider, physics, unity 5, hibby games, hibby, games, asmr, learning, tutorial, aarons assets, asset, asset store, free asset, wheelcollider, collider, aaron hibberd, hibby kart, how to make games, racing, cars
Id: BG7UMUWojik
Channel Id: undefined
Length: 20min 28sec (1228 seconds)
Published: Fri May 19 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.