Unity3D How To: Driving With Wheel Colliders

Поделиться
HTML-код
  • Опубликовано: 24 дек 2024

Комментарии • 429

  • @agenttatsu
    @agenttatsu 5 лет назад +135

    This tutorial is the best of all the tutorials I've watched on this subject. Excellent microphone quality, minimal editing, clear speaking, clear explanations, and very quick!

    • @mikethegamedev
      @mikethegamedev 4 года назад +1

      69 likes Lol

    • @dwinkley
      @dwinkley 4 года назад +2

      Yes, Finally someone who doesn't type like a grandpa

    • @fixyourautomobile
      @fixyourautomobile 4 года назад

      @@dwinkley HEY NOW MISTER THATS NOT FUNNY SOMETIMES WE DO IT FOR FUN

    • @dwinkley
      @dwinkley 4 года назад

      @@fixyourautomobile ?

    • @dwinkley
      @dwinkley 4 года назад

      @@fixyourautomobile Oh i know

  • @blueberryguitarra
    @blueberryguitarra 6 лет назад +56

    I used a different car from the asset store, and it accelerated extremely slowly. I had to decrease mass value for the whole car, increase the wheel collider radius (so that it collided with the ground) and increase motor torque to a lot more, and also changed friction values slightly. Just in case anyone faces the same problem.
    Anyway, great tutorial, it was very clear and easy to follow. I will check your channel for more! Thank you.

    • @박진욱-r3s
      @박진욱-r3s 6 лет назад +1

      thanks a lot *____*

    • @lemonface2938
      @lemonface2938 6 лет назад +5

      WIWOSEOAW48PS I know it’s late but if you scaled game object with the driving script attached to it you would change the physics I think.

    • @samdavidpaul
      @samdavidpaul 5 лет назад +1

      @@lemonface2938 yeah u r correct. It changes the physx. I experienced that bug.

    • @aleksapetrovic7088
      @aleksapetrovic7088 5 лет назад +1

      @@lemonface2938 thanks

    • @lukascook8477
      @lukascook8477 4 года назад +1

      Bro, I'm not even kidding. Thanks to your comment, I solve a problem that involved hours of research. I forgot to increase the collider radius...

  • @ork_ork
    @ork_ork 3 года назад +4

    After 3 years your tutorial is still amazing

  • @lucidjuice101
    @lucidjuice101 3 года назад

    If anyone of you have been stuck with the movement, just make sure the car's collider is above the wheel's collider. I don't know if I didn't pay attention but I got stuck on it for 2 days. Thanks for the tutorial. Loved it.

  • @famethius
    @famethius 6 лет назад +6

    Thank you thank you thank you! I've been struggling through the wheel collider tutorial on Unity's site for two days. The tip you had about adding an additional Box Collider to the root car node (around 9:00) was the trick that fixed my crazy bouncing car!

    • @AllFather414
      @AllFather414 6 лет назад

      Hello, I did the same as mentioned in the tutorial still my car is bouncing. Can you help?

    • @tommywicaksono
      @tommywicaksono 6 лет назад

      @@AllFather414 same with me . help please

    • @not_herobrine3752
      @not_herobrine3752 4 года назад

      for me, i forgot to increase the mass from one to something higher

  • @meddie79
    @meddie79 6 лет назад +53

    Can you do a follow up video for handling different road surfaces. Asphalt vs dirt for example.

    • @sweftis8300
      @sweftis8300 6 лет назад +21

      I think, you need to add triggers on road, and change wheelcollider friction's settings when you in trigger. That easy

    • @TheRealMobiius
      @TheRealMobiius 6 лет назад +20

      @@sweftis8300 physic materials. ;)

    • @bartwestenenk6088
      @bartwestenenk6088 5 лет назад +8

      @@sweftis8300 or add different friction for the ground and keep the wheel friction static

    • @arsylgames
      @arsylgames 4 года назад +1

      @@bartwestenenk6088 that doesn't work that good... Just change the wheellcollider sideways slip and forward slip based on the ground physics material. RCC for example does that'

  • @karthuslin4005
    @karthuslin4005 2 года назад +1

    It helps with my graduation project a lot.Thanks

  • @seahawk913
    @seahawk913 5 лет назад +63

    In case your car moves too slowly when accelerating: Try scaling your model (ALL parts of the car + colliders etc) downwards. I somehow assume that the "unity physics system" takes the model size - relative to the world grid size - into consideration when applying physics to it.
    Somewhere I read, that the grid squares (the smallest one if you zoom in) represent "1 meter". Originally my model was about 8 meters long and accelerated horribly slow. I scaled it from (1,1,1) to (0.2,0.2,0.2) and that did the trick.

    • @gregoryfenn1462
      @gregoryfenn1462 5 лет назад +4

      Correct, a transform gap of 1 is one meter, and this is linked to the physics notion of a Newton (1kg * meter * meter / second * second). So size does matter when if comes to physics-driven acceleration in Unity.

    • @RobertoOrtis
      @RobertoOrtis 4 года назад +1

      Won't the car look too small compared to other objects? Or is there something I am not getting...?

    • @seahawk913
      @seahawk913 4 года назад +3

      The car shouldn't look smaller, if you scale all of your other world objects (houses, trees, etc) to the same relative size (like in the real world). Maybe my applied scale (0.2) was too small. I haven't done a lot of experiments with it, but I think you should still be able to have larger cars (8m). Maybe the mass was too big for the adjusted torque of the wheel colliders.
      Try therefore different values for the mass of the car or wheel collider properties (torque, stiffness, etc) to get the driving behavior you wish.
      Another thing I learned in UE4 (but can't remember if it is present in Unity) was friction between ground and wheels. This kind of parameter plays an important role for acceleration and steering too.

    • @RobertoOrtis
      @RobertoOrtis 4 года назад +2

      @@seahawk913 thank you, I will look into those. Won't, lowering the friction, make it look like the car is skating on ice?

    • @seahawk913
      @seahawk913 4 года назад +1

      @@RobertoOrtis Yes, this is exactly going to happen, if you set the fricition too low. Setting the friction too high may get you an unrealistically stable car. But in the end, it all depends on how you want the car to behave in your game.

  • @kishantakoordyal
    @kishantakoordyal 5 лет назад +2

    Helpful af to me multiple times. Mainly the placement of the wheel colliders and the excellent settings to 'tune' them.

  • @wullum8902
    @wullum8902 5 лет назад +27

    this was excellent. video was long, so i was expecting a lot of time wasting, but there really wasn't any. straight to the point and easy to follow.

  • @Lukas-dz7oe
    @Lukas-dz7oe 5 лет назад +4

    For those whose car is not moving...
    I was able to solve this by tweaking the wheel collider's radius (.6 in my case) and changing the motor force (1000 in my case) or resizing the object to a smaller size.

    • @athenasowl1857
      @athenasowl1857 3 года назад

      hell yeah exactly what I needed thank you(:

  • @SteelandSouls
    @SteelandSouls 4 года назад +10

    Great Tutorial but I have this issue.
    I applied Wheel Colliders to my Wheels and everything "technically" works. Problem is that when Play is hit, all 4 wheels flip sideways.
    Any thoughts as to why that might be or - if not - how I could patch something like that?

    • @kingbling7571
      @kingbling7571 3 года назад +1

      U have the cheat code activated that makes the wheels go sideways thus allowing you to run it on water like in GTA!
      K, jokes aside, I think it's because the car collider is clashing with the wheels collider that's why

    • @albertoneto4781
      @albertoneto4781 3 года назад

      It could be indeed your wheels colliding with your car's box collider. A good way to solve this is by setting custom layers for your tires and car, and setting inside the physics tab in project settings so the two layers won't have physical interactions.

    • @Cerions33
      @Cerions33 3 года назад

      @@albertoneto4781 Have the same problem and I tried resolving your way but it doesn't work..

    • @albertoneto4781
      @albertoneto4781 3 года назад

      @@Cerions33 maybe check the suspension size? in the gizmos they are those orange vertical lines. If they are too big, your wheels will start to tilt when you keep constantly turning.

    • @ankitwarkade6920
      @ankitwarkade6920 2 года назад

      I think your wheels may not be oriented right,
      Or try this...
      Create an empty game object and copy transform from a wheel. After the empty game object is in the position of wheel, you should make wheel object as a child of this empty gameobject. That empty gameobject should be oriented as wheel collider of this wheel and try offsetting the wheel mesh rotation to counter its behaviour in the game mode.

  • @chosenvan
    @chosenvan 4 года назад

    50 motor force is low for 1500 mass. I followed tutorial and put 300 for motor force.
    Its working perfectly. Thank you so much.
    Now, I can make a race game against asphalt :)))

  • @romanbyy
    @romanbyy 3 года назад +1

    If your car doesn't move or move too slow, try to make the car smaller, it worked for me. And thanks for the tutorial

  • @NachoMan154
    @NachoMan154 5 лет назад +1

    Fixed update should be used for physical Calculations and Update for Input/Output. Update is called every frame, FixedUpdate is called 30 or 60 times per second.

  • @stealthy17
    @stealthy17 5 лет назад +1

    regarding FixedUpdate and LateUpdate... Basically before Update is ran there is a before and after update method that you can use for physics (before) and camera (after) respectively most commonly which can fix stutter for the camera when all other object movement is already processed for example... this was mentioned in one of the tutorials

  • @0ernij0
    @0ernij0 3 года назад

    This is the best tutorial here. Everything in the script is so neatly orchestrated this just works! Much thanks!

  • @TheGrimmy
    @TheGrimmy 2 года назад

    That was beautiful. You made a legitimate baby out of that code, and all I have left to say is: Mazel Tov!

  • @alexandreamiel1865
    @alexandreamiel1865 4 года назад

    best tutorial for wheel colliders, physics working fine

  • @chazgw7676
    @chazgw7676 3 года назад +1

    If you want to make aligning anything much easier, use the isometric view by clicking on the small white cube in the middle of the xyz selector found in the upper right of your Scene tab window.

  • @arshigupta9076
    @arshigupta9076 3 года назад +2

    please help me, my wheels are revolving but car isnt moving How to fix this??

    • @g3o497
      @g3o497 3 года назад

      i have the same issue my man

    • @arshigupta9076
      @arshigupta9076 3 года назад

      @@g3o497 well i got solution, just increase your wheel collider radius to exact 0.34 .it worked for me and make sure you do it in all 4 of them

    • @g3o497
      @g3o497 3 года назад

      @@arshigupta9076 Thanks i will try

    • @yatharthsharma1108
      @yatharthsharma1108 3 года назад

      @@arshigupta9076 Worked for me, thank you!

  • @rizharwira9729
    @rizharwira9729 4 года назад +3

    Hey bro, i got this problem "cannot implicitly convert type unityengine.quaternion' to unityengine.Vector3', how can i solve it?

    • @rapte74
      @rapte74 4 года назад +1

      Me too bro .. did u get ans or any fix?

    • @damiankirstein3311
      @damiankirstein3311 4 года назад +1

      Look at Quaternion class, it's not the same as Vector3. Read a documentation, it takes 4 arguments (instead of 3).

    • @rizharwira9729
      @rizharwira9729 4 года назад

      @@damiankirstein3311 so now what?

    • @xdoge0001
      @xdoge0001 3 года назад

      28:40

  • @Only4GamersXyz
    @Only4GamersXyz 4 года назад +1

    I done everything as Tutorial but car moving very slow when Accelerating+Steering. What can be the reason? I even using same Low Poly Destructible Car. Is unity physics changed in 3 years? Please reply.

  • @Gunbarrelguru
    @Gunbarrelguru 6 лет назад +10

    When I play it the wheels are rotated 90 degrees and it doesn't work :/ any ideas?

    • @nischalkharel6852
      @nischalkharel6852 6 лет назад +2

      same problem with me did u solve it

    • @jarratt51
      @jarratt51 5 лет назад

      Go into the program you used to make the car model and wheels with and rotate the models accordingly

    • @nahfamimgood
      @nahfamimgood 5 лет назад +3

      If above dosen't help put the wheel in a empty game object rotate them 90 inside of that object and use that object for placement

    • @adilizm704
      @adilizm704 4 года назад

      seem problem

  • @abhinoorsingh3770
    @abhinoorsingh3770 2 года назад +1

    Great Tutorial, But I have a Problem in Stopping The Car
    I Pressed "S" but Car Keeps on rolling

  • @callamb4351
    @callamb4351 5 лет назад

    I know im late to the party but ive spent a long time and a lot of tutorials deep to get these Wheel colliders working bug free - this is the first tutorial to do that thanks for the Video homie.

  • @fecoramirez
    @fecoramirez 3 года назад

    As others have pointed out, best tutorial in the subject. I manage to easily adapt a Cinemachine camera to the setup and it's working smoothly. Thanks a lot!

  • @M0TYSHIZ
    @M0TYSHIZ 5 лет назад +21

    I got way more out of this than I expected to.
    Instant sub, thanks so much!

  • @digitalpanda5969
    @digitalpanda5969 Год назад +1

    float angle = max_angle * Input.GetAxis("Horizontal");
    front_wheel.steerAngle=angle;

  • @thehand2466
    @thehand2466 2 года назад +1

    It's work.. but why my car's wheel(mesh wheel) goes crazy when I on the player mode? Help plss

  • @kingeliasyt
    @kingeliasyt 3 года назад +1

    Literally the first useful video I've found on wheel colliders.
    I do have one issue, everything works fine but the car doesn't move (the wheels turn and rotate, there are no errors) the car just doesn't move :c

    • @SuperNitr0x
      @SuperNitr0x 3 года назад

      I have the same problem, has anyone figured out why?

  • @FoXcodeZ
    @FoXcodeZ 3 года назад

    Even after few years this tutorial is very useful for me. Great job.

  • @lukakion2978
    @lukakion2978 4 года назад +2

    My car is flipping every time i turn left or right.How can i solve the problem?

  • @tahirciger8344
    @tahirciger8344 4 года назад +1

    If I dont make the motorForce= 5000, my car is driving very very slowly. What is the reason of this?

  •  3 года назад +2

    your naming skills are awful xD
    but the tutorial is one of the best I've ever seen... good job man

  • @mathew3267
    @mathew3267 5 лет назад +3

    Great tutorial, I especially love the camera code. I was having a lot of jitter following a rigidbody but your code smooths it all out.

    • @TheGrimmy
      @TheGrimmy 2 года назад

      this is so long ago but in case other people see, you need to rename the Update() as LateUpdate() or even FixedUpdate() and retry. Should remove the stutter.

  • @PraYogiz
    @PraYogiz 5 лет назад

    I come here because I want to know how carting microgame template in Unity work. And this tutorial is very help full. Your tutorial is very good and straightforward. From now on, will be your subscriber ^_^

    • @hdprodesignteam231
      @hdprodesignteam231 4 года назад

      If you want to see a real car controller that can challenge to forza just check this ruclips.net/video/oYlMXMozuxg/видео.html video and download playable demo from this link drive.google.com/file/d/1dIe9oqD75A1w7LgpjXRx1ZDMXlvgpZb4/view?usp=sharing
      On Unity Asset Store: assetstore.unity.com/packages/tools/physics/hd-car-controller-155461
      You Tube Channel: ruclips.net/channel/UCivLavXhYn-Ap0IJcNMjmeg?view_as=subscriber
      HDCarController Version 2 will be on asset store soon.
      HDProDesign Team

  • @DimeF1
    @DimeF1 3 года назад

    when I press play my car starts breakdancing for some reason, dunno how to fix it

  • @gameeverything687
    @gameeverything687 5 лет назад +2

    So, when I drop my vehicle, the wheel colliders stop at the ground plane, but the meshes pass through for about three to five frames. It's barely noticeable, but we can't exactly have wheels passing through solid objects, lol. Any ideas? I'm almost tempted to just program my own wheel colliders.

  • @sheldonjanzen3483
    @sheldonjanzen3483 2 года назад +1

    Extremely important...the top parent transform in your vehicle must have a box collider or something similar attached or it will just make your vehicle go crazy bouncing. Struggled for the last 24 hours

  • @the_pachu4953
    @the_pachu4953 5 лет назад +2

    One of the most useful tutorial so far!

  • @lolathomas1965
    @lolathomas1965 4 года назад +3

    When I put in the script into the car it flies int random directions. The script is all correct.plz help

    • @arthurdodsonbates9572
      @arthurdodsonbates9572 4 года назад +1

      Same

    • @lolathomas1965
      @lolathomas1965 4 года назад

      I corrected it but still I cannot turn

    • @ahmd-salh
      @ahmd-salh 4 года назад

      the reason it flies is that the mass is low increase the mass of the rigidbody and it should be working just fine

    • @andy_7_744
      @andy_7_744 4 года назад

      @@ahmd-salh no wotk,i set at 10k mass,and she fly

    • @andy_7_744
      @andy_7_744 4 года назад

      Work*,srry for my bad english

  • @cptray-steam
    @cptray-steam 4 года назад +3

    would it be smart to use an array for the wheel colliders? This way it's all in one variable? Just curious.

  • @nononzone
    @nononzone Год назад

    hey. Thanks for the video. I have the problem that when I stop the car, it still moves around. Set motor torque to 0 and added a brakeforce. The wheels don't move, but the vehicle is sliding around on the plane.
    Do you have a soluition for that?

  • @VRWarehouse
    @VRWarehouse 6 лет назад +1

    for anyone not sure about the template he is using its not from the store it comes with Unity blogs.unity3d.com/2018/04/26/how-to-get-the-most-out-of-the-new-unity-project-templates-in-2018-1/

  • @RivenbladeS
    @RivenbladeS Год назад

    vre poutana how is the car moving ??? ytou didnt apply any modifications to transform. only to wheel coliders and their graphics

  • @mohsinkhatri1290
    @mohsinkhatri1290 4 года назад +32

    Cars don't need brakes right , just kidding.
    here is code for brakes (brakes = hand brake).
    but you can apply it to all the w_colliders.
    [
    add this in the Accelerate void or make new one for the brakes called brakes.
    frontDriverW.brakeTorque = m_brakeInput * brake;
    frontPassengerW.brakeTorque = m_brakeInput * brake;
    and make a float like this float public brake = 500;
    ]

  • @bchshz
    @bchshz 3 года назад

    my wheel colliders are sideways and it doesent let me rotate them

  • @Nenea__
    @Nenea__ 3 года назад

    I have a problem, wheels is spining but car is not stuck and i dont know what to do

  • @nargesshakerian7946
    @nargesshakerian7946 Год назад

    Hi, I wrote a code similar to this but when I run the car start moving backward without any input, I tried several ways but the only thing has changed is the direction of the initial movement, I mean the car starts going forward initial after runic the fame. Does anyone have any idea in this case?

  • @madebymartins
    @madebymartins 4 года назад +1

    Noice,
    My car was bouncing around but I forgot to add more weight and it fixed it all

  • @tedwilson5550
    @tedwilson5550 3 года назад +1

    I followed this tutorial and it worked excellent. I then tried to follow this using the golf cart download from the asset store and I can NOT get it to work. It starts spinning and or takes off, or flips over after adjusting the settings. I'm stumped. I was trying to make a golf cart racing game. Any suggestions?

    • @metromap9618
      @metromap9618 3 года назад +1

      Have you tried increasing the wheel size radius ?

  • @YarinZit
    @YarinZit 2 года назад

    If I watch this video in 2022 ...
    How do I download this edition of the video you are using?

  • @TheOneWithComments
    @TheOneWithComments 3 года назад

    The only issue ive been having is that when i hit play the wheel colliders are bouncing like crazy/stuttering on a flat surface as if they were on an extremely bumpy road. so far I've had no luck figuring out why.

  • @ankitwarkade6920
    @ankitwarkade6920 2 года назад

    Excellent tutorial for Wheel Colliders. But I have a doubt. In UpdateWheelPose() method where we are actually modifying the wheel mesh transform with the wheel collider transform, i didn't understand the initializing of Vector3 _pos and Quaternion _quat by storing wheel's current position and rotation. Because that function is running without errors with just initializing _pos and _quat, and not storing values into them. They are already getting updated in _collider.GetWorldPose(out _pos, out _quat). If anybody can explain, please!!

  • @think9091
    @think9091 3 года назад

    Hey i have my car up and ready but the wheels clip through the ground did i miss something? i have wheel colliders

  • @_bug56
    @_bug56 5 лет назад +1

    I had an issue with the tire geometry clipping through the floor and it took me a little too long to realize the wheel collider's radius should NOT be .08 like mentioned in the video. I used .25 scale, just like you said but the wheel radius was way too small and should actually be 0.34

  • @George-br9xq
    @George-br9xq 2 года назад

    the car does not move, half of the tires are in the middle of the floor when the game starts :(, help

  • @mike1hav
    @mike1hav Год назад

    Hmm. My wheels spin, but the car does not move for me. This replaced a previous script which did get the car to move!!

  • @theabbie3249
    @theabbie3249 2 года назад

    is the updateWheelPoses() to just update the visuals or to actually drive the car? Will it also drive without that function if I don't want to update any visuals?

  • @bellanurhaliza5471
    @bellanurhaliza5471 3 года назад

    I've tried, but the car doesn't move. What is wrong?

  • @berksahin3616
    @berksahin3616 4 года назад +1

    hello, when im trying to delete frontdriver reardriver frontpassenger and rearpassenger's materials (cylinder001, rimsize, rimtire) i get "cannot restructure prefab instance" error how can i fix it ?

    • @sentyfb
      @sentyfb 4 года назад +1

      Right click on any of the blue highlighted objects in the hierarchy (where it lists everything), and click Unpack Prefab Completely.

    • @hdprodesignteam231
      @hdprodesignteam231 4 года назад

      If you want to see a real car controller that can challenge to forza just check this ruclips.net/video/oYlMXMozuxg/видео.html video and download playable demo from this link drive.google.com/file/d/1dIe9oqD75A1w7LgpjXRx1ZDMXlvgpZb4/view?usp=sharing
      On Unity Asset Store: assetstore.unity.com/packages/tools/physics/hd-car-controller-155461
      You Tube Channel: ruclips.net/channel/UCivLavXhYn-Ap0IJcNMjmeg?view_as=subscriber
      HDProDesign Team

  • @jonathanpascal3505
    @jonathanpascal3505 5 лет назад +1

    hi guys, i did everything but when i want to move my front wheels rotate but my car does not move
    please help me...

    • @rayhanhussain1088
      @rayhanhussain1088 5 лет назад +2

      Make sure your box collider does not go bellow your wheel colliders. So lift you box collider above your wheel collider. Give it a go buddy.

    • @jonathanpascal3505
      @jonathanpascal3505 5 лет назад

      Thank you, I fixed it...
      And now I try to make a script to break but it doesn’t work.
      It’s possible to help me please??

  • @blablabla1196
    @blablabla1196 5 лет назад +1

    My car goes flying up real quick at start of runtime. If I slash slash the code out of UpdateWheelPoses, then it goes away, but of course I can't move at that point. Any help???
    EDIT: Figured it out. Instead of transform.position = pos, I reversed it to pos = transform.position, as well as for rotation. Worked for me, hope this helps someone else.

  • @trajkott
    @trajkott 3 года назад

    4:42 how I can Copy that ?

  • @rashedkhan358
    @rashedkhan358 3 года назад

    Please help, I tried on a different car and it's going really slow, how do i fix this?

  • @cptray-steam
    @cptray-steam 4 года назад +2

    If anyone wants to add the ability to control what the vehicle's drive type is, I messed around a bit and basically I just created three bools:
    public bool fourwheeldrive = false; // 4WD
    public bool rwd = false; // RWD (Rear Wheel Drive) 2WD Mode.
    public bool fwd = false; // FWD (Front Wheel Drive) 2WD Mode.
    Then in the void Accelerate() I replaced the code RC used with this:
    if (!fourwheeldrive && rwd)
    {
    rLWC.motorTorque = m_verticalInput * motorForce;
    rRWC.motorTorque = m_verticalInput * motorForce;
    } else if (!fourwheeldrive && fwd)
    {
    fLWC.motorTorque = m_verticalInput * motorForce;
    fRWC.motorTorque = m_verticalInput * motorForce;
    } else if (fourwheeldrive)
    {
    fLWC.motorTorque = m_verticalInput * motorForce;
    fRWC.motorTorque = m_verticalInput * motorForce;
    rLWC.motorTorque = m_verticalInput * motorForce;
    rRWC.motorTorque = m_verticalInput * motorForce;
    } else
    {
    Debug.Log("Drive Type not defined.");
    }
    Hope this helps anyone. Note that you will have to replace all of the rLWC, rRWC, etc. with your variables.

  • @geniusboi2519
    @geniusboi2519 6 лет назад +1

    I have a problem that I've been working on for two days now...its that my wheels are floating around my vehicle.
    my wheel colliders are working fine but my wheels are not.

    • @theOrdinaryDev
      @theOrdinaryDev 6 лет назад +1

      I have the same problem....have you found any solution yet?

    • @geniusboi2519
      @geniusboi2519 6 лет назад

      Yes I have...make sure to make the wheels a child of an empty GameObject and The GameObject a child of the Car Body then place the empty game objects in the "wheel" section in the inspector and that should fix it

    • @tommywicaksono
      @tommywicaksono 6 лет назад

      @@geniusboi2519 can you explain to me? i don't understand

    • @jonathanturner8034
      @jonathanturner8034 5 лет назад

      instead of putting the wheel colliders on the wheels themselves (meaning the game object with the mesh renderer component) create 4 (or how ever many wheels you have) separate empty game objects that will serve as the parent for each wheel. Then put the wheel collider component on those newly created parent game objects and put those parent objects in the wheel collider fields in the inspector view. BTW the parent game objects should be the child of the car body. Hope that helps somebody one day :) @@tommywicaksono

  • @CrazyWiz
    @CrazyWiz 4 года назад

    Can we stop the car immediately after releasing input?

  • @Motimen_sura
    @Motimen_sura 3 года назад

    Sir how to get that script unter things plz sir reply i code correctly ....

  • @DonYurik
    @DonYurik 4 года назад

    I used another car model, and added cylinders instead of wheels. The wheels respond to input, but fall down when i press play

  • @robosergTV
    @robosergTV 5 лет назад +1

    big thanks for the video! Everything works but the handling of the car feels weird (acceleration / breaking). It is as if the car has strong momentum. You can see it if you drive back and forth. Increasing the motor force doesn't help - the inertia / momentum is still working and increasing the force makes it worse.

    • @pitbullturtle
      @pitbullturtle 5 лет назад

      lower the mass of the wheelcolliders

  • @Michael-kl2un
    @Michael-kl2un 4 года назад

    It's not letting me drop the wheel colliders into the collider section

  • @stavrosa7871
    @stavrosa7871 4 года назад

    I have a problem. My wheels spin and move left & right but my car does not move at all. Any suggestions ? Thanks !!

    • @RenaissanceCoders
      @RenaissanceCoders  4 года назад

      You may try reducing your car's mass setting on the rigidbody.

    • @stavrosa7871
      @stavrosa7871 4 года назад

      @@RenaissanceCoders thank you so much it works ! :)

    • @sagitta98
      @sagitta98 4 года назад

      @@RenaissanceCoders Weird, I have similar problem with my test box car. Tried to reduce the weight to 1000 but no effect.

  • @bioman1hazard607
    @bioman1hazard607 5 лет назад +3

    I made a custom car mesh and set all the settings as instructed, but the vehicle wont move at all. The tires turn but there is no forward movement

    • @sidratulislam
      @sidratulislam 5 лет назад +2

      try reducing box collider volume from down

    • @izzatsuarex4310
      @izzatsuarex4310 5 лет назад +1

      Sidratul Islam thank you broooo

  • @optigearstudios6161
    @optigearstudios6161 5 лет назад

    Is there a chance you could make a video with this controller, adding sound and breaking?

    • @optigearstudios6161
      @optigearstudios6161 5 лет назад

      @@t_broek I was able to integrate braking, still no clue how to add proper sound to it though. Regardless, thanks for making this series it helped.

    • @JurajHusekGameStudio
      @JurajHusekGameStudio 4 года назад

      @@optigearstudios6161 can you please share your way of adding braking? It would be very helpful. Thank you!

  • @Croccolucho
    @Croccolucho 4 года назад

    How can i do that but, with UI buttons?

  • @sebasA
    @sebasA 2 года назад

    Hi, I followed the tutorial but my car nevers stops, is like the wheels dont have any friction or lose. Im using the default Wheelcolider values. Great video!

  • @SoulBlessin
    @SoulBlessin 5 лет назад

    Hey good job, but i''m running into a problem here ...
    while the left side of mt car is working awesome my right side front and back wheels are turned inside out and the only way to disable that from happening is...
    private void UpdateWheelPoses()
    {
    UpdateWheelPose(frontLW, frontLWT);
    //UpdateWheelPose(frontRW, frontRWT);
    UpdateWheelPose(rearLW, rearLWT);
    //UpdateWheelPose(rearRW, rearRWT);
    }
    But then again they look ok but do not spin any suggestions?

  • @theemeraldfalcon9184
    @theemeraldfalcon9184 4 года назад

    How can I change the direction the wheels rotate in?

  • @ravishah6403
    @ravishah6403 5 лет назад +2

    My car behaves weird just like in the start of the video. Please help.
    I am using Unity 2018.3.9f1

  • @farokzaid4568
    @farokzaid4568 4 года назад

    how to fix error : error CS1061: Type `UnityEngine.WheelCollider' does not contain a definition for `GetWorldPose' and no extension method `GetWorldPose' of type `UnityEngine.WheelCollider' could be found (are you missing a using directive or an assembly reference?)

    • @NECjAR
      @NECjAR 4 года назад

      Looks like you missing a using directive or an assembly reference.

  • @nicholasbrave1
    @nicholasbrave1 4 года назад

    I'm getting a Syntax error the way the camera script is currently written, error CS1003. Any ideas? (total newb)

  • @wassimmefteh401
    @wassimmefteh401 4 года назад

    i wanted to ask, how ti implement a brake to it ?

  • @Lormax23
    @Lormax23 4 года назад

    First time seeing your channel. Instant subscribe. Thanks for the great tutorial!

  • @nehasandhansive6762
    @nehasandhansive6762 3 года назад +1

    But what about drifting?

  • @Windstale
    @Windstale 4 года назад

    can i use this for my game project? and how to use this as mobile inputs like steering wheel and acel&break buttons ?

  • @harmoniac.design
    @harmoniac.design 4 года назад +6

    Thank you for the tutorial :) for such complex behaviour its actually pretty easy to set up.
    One thing I noticed is, that you use Time.deltaTime but are updating in FixedUpdate(). Maybe this is the reason your followMovement becomes jittery sometimes. Time.deltaTime relates to Update() / lateUpdate(), whereas Time.fixedDeltaTime relates to FixedUpdate().
    I'm actually wondering why there isn't a LateFixedUpdate()...
    Interesting _codingStyle btw. ^^ Didn't know you can put methods before variables. I haven't made use of the underscore yet. Thinking of adapting that.

    • @hdprodesignteam231
      @hdprodesignteam231 4 года назад

      If you want to see a real car controller that can challenge to forza just check this ruclips.net/video/oYlMXMozuxg/видео.html video and download playable demo from this link drive.google.com/file/d/1dIe9oqD75A1w7LgpjXRx1ZDMXlvgpZb4/view?usp=sharing
      On Unity Asset Store: assetstore.unity.com/packages/tools/physics/hd-car-controller-155461
      You Tube Channel: ruclips.net/channel/UCivLavXhYn-Ap0IJcNMjmeg?view_as=subscriber
      HDProDesign Team

    • @andrewnattress
      @andrewnattress 3 года назад +2

      Time.deltaTime returns Time.fixedDeltaTime if called within the fixed update loop.

  • @bimanlakhe9656
    @bimanlakhe9656 4 года назад

    My wheels get stuck to the ground what to do?

  • @dankaro8996
    @dankaro8996 3 года назад

    The collider doesn't work at all, it goes through on my tire and even when I tried using a cylinder straight from unity itself it still didn't work but capsule collider does for some reason

  • @arnoldthegreat4138
    @arnoldthegreat4138 2 года назад

    my wheels are rotated 180 lol how do u fix that?

  • @ogidarmatena
    @ogidarmatena 2 года назад

    how to add audio?

  • @Norinot1
    @Norinot1 4 года назад

    For some reason my car is slow which I fixed but my car wheels are flying away from my car for god knows why. I know that its because of the transform but I can't seem to make it work.

  • @DU5TCLAN
    @DU5TCLAN 4 года назад

    I've tried to combine this tutorial with my logitech G29. It worked pretty good just one thing when I fully press down my accelerate paddle, my camera jitters. (I've added my camera as a child to the car for now.)

  • @TheRainHarvester
    @TheRainHarvester 5 лет назад

    How did the wheels know how to turn graphically?

  • @erfanzandi1362
    @erfanzandi1362 Год назад

    sorry but mine dose not collide with the ground(cube)...the only collider that collide is box collider of parent...

  • @dama897
    @dama897 4 года назад

    Can anybody tell me if in making turns (in this tutorial script) is involved any friction force or this turns are just made by calculating the position of the wheels and the input from the arrows?

  • @scrappy9626
    @scrappy9626 3 года назад

    Cool video but my wheels fall down when I hit play any solutions for that?

    • @Angel-fu4mq
      @Angel-fu4mq 3 года назад

      parent the wheels to the car object or car body and they won't fall

  • @VicMcFly111
    @VicMcFly111 5 лет назад

    My car is moving and my wheels turn, etc. but I have a problem: all my four wheels turn 180 degrees when I press play. Like the hubcaps turn to the center of the vehicle and the inner rim turns away from the vehicle. I have tried to set them 180 degrees to the other direction but haven't yet found a working solution. Anyone know what I should do?

    • @M4TF1
      @M4TF1 5 лет назад +1

      I had a similar problem where all four of my wheels faced upwards.
      I suggest you position you wheels in the correct position in the scene, i.e make sure the wheels are facing outwards, then create an empty game object for each wheel (which you can then drag each wheel into to make it a child of it). Make sure that the empty Game object is at the same position as the wheel otherwise the wheel will rotate around the game object's location instead of its own centre. Then, drag each empty game object into the movement script assigned for the collider instead of the wheel itself. This should fix the issue since the script will modify the rotation of the game object in relation to the world (which in turn modifies the rotation of the wheel relative to the game object) instead of the wheel itself, which would change the orientation of the wheel.
      If that doesn't work you could always try to move the wheel colliders on the left side of the car to the right side and vise versa to see if that helps.

  • @DARK_AMBIGUOUS
    @DARK_AMBIGUOUS 3 года назад +1

    Who else is here because they’re car is doing what the car at 0:25 is doing?