Unity3D How To: Driving With Wheel Colliders

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 มิ.ย. 2018
  • ⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I've been using Kite for 6 months and I love it! www.kite.com/get-kite/?...
    Download the project!
    github.com/coderDarren/Unity3...
    Vehicle used from the asset store.
    assetstore.unity.com/packages...
    In this video, you will learn how to structure your hierarchy to meet the WheelCollider demands. You're going to write code that allows you to easily drive a vehicle around within your Unity3D scene, and if you want to go the extra mile, hang around for a few extra minutes to code up the camera controller that follows the vehicle from behind while you drive.

ความคิดเห็น • 428

  • @agenttatsu
    @agenttatsu 5 ปีที่แล้ว +134

    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 3 ปีที่แล้ว +1

      69 likes Lol

    • @dwinkley
      @dwinkley 3 ปีที่แล้ว +2

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

    • @fixyourautomobile
      @fixyourautomobile 3 ปีที่แล้ว

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

    • @dwinkley
      @dwinkley 3 ปีที่แล้ว

      @@fixyourautomobile ?

    • @dwinkley
      @dwinkley 3 ปีที่แล้ว

      @@fixyourautomobile Oh i know

  • @ork_ork
    @ork_ork 3 ปีที่แล้ว +4

    After 3 years your tutorial is still amazing

  • @kishantakoordyal
    @kishantakoordyal 4 ปีที่แล้ว +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.

  • @0ernij0
    @0ernij0 2 ปีที่แล้ว

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

  • @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 ปีที่แล้ว

      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.

  • @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!

  • @Kitsune001Kei
    @Kitsune001Kei 2 ปีที่แล้ว

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

  • @blueberryguitarra
    @blueberryguitarra 5 ปีที่แล้ว +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.

    • @user-je9vb6dj3t
      @user-je9vb6dj3t 5 ปีที่แล้ว +1

      thanks a lot *____*

    • @lemonface2938
      @lemonface2938 5 ปีที่แล้ว +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 4 ปีที่แล้ว +1

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

    • @aleksapetrovic7088
      @aleksapetrovic7088 4 ปีที่แล้ว +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...

  • @the_pachu4953
    @the_pachu4953 4 ปีที่แล้ว +2

    One of the most useful tutorial so far!

  • @karthuslin4005
    @karthuslin4005 2 ปีที่แล้ว +1

    It helps with my graduation project a lot.Thanks

  • @alexandreamiel1865
    @alexandreamiel1865 3 ปีที่แล้ว

    best tutorial for wheel colliders, physics working fine

  • @M0TYSHIZ
    @M0TYSHIZ 5 ปีที่แล้ว +21

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

  • @famethius
    @famethius 5 ปีที่แล้ว +5

    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 5 ปีที่แล้ว

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

    • @tommywicaksono
      @tommywicaksono 5 ปีที่แล้ว

      @@AllFather414 same with me . help please

    • @not_herobrine3752
      @not_herobrine3752 3 ปีที่แล้ว

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

  • @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.

  • @MrSansibaer
    @MrSansibaer ปีที่แล้ว

    Great Tutorial ! Very clear & clean coding!👍

  • @Lormax23
    @Lormax23 3 ปีที่แล้ว

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

  • @changshuaiwang8966
    @changshuaiwang8966 3 ปีที่แล้ว

    It is really a great, wonderful, excellent work. Thank you so much. Keep on coding!

  • @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.

  • @simonmathis5318
    @simonmathis5318 5 ปีที่แล้ว +64

    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...?

    • @simonmathis5318
      @simonmathis5318 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

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

    • @simonmathis5318
      @simonmathis5318 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.

  • @PraYogiz
    @PraYogiz 4 ปีที่แล้ว

    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 th-cam.com/video/oYlMXMozuxg/w-d-xo.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: th-cam.com/channels/ivLavXhYn-Ap0IJcNMjmeg.html?view_as=subscriber
      HDCarController Version 2 will be on asset store soon.
      HDProDesign Team

  • @Maggiethegsd
    @Maggiethegsd 3 ปีที่แล้ว

    Great video! It was easy to understand, liked and subscribed!

  • @TheGrimmy
    @TheGrimmy ปีที่แล้ว

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

  • @Only4GamersXyz
    @Only4GamersXyz 3 ปีที่แล้ว +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.

  • @X_Daniel466
    @X_Daniel466 5 ปีที่แล้ว

    So hard find good videos, thanks hope you will make more video that continues with this car physics.

  • @eddnufc93
    @eddnufc93 5 ปีที่แล้ว

    One of the best unity tutorials I've come across! Subscribed!

  • @JadonBarnes
    @JadonBarnes 5 ปีที่แล้ว +1

    This has been incredibly helpful! Thanks!!!

    • @andy_7_744
      @andy_7_744 4 ปีที่แล้ว

      Can you help me

    • @hdprodesignteam231
      @hdprodesignteam231 4 ปีที่แล้ว

      If you want to see a real car controller that can challenge to forza just check this th-cam.com/video/oYlMXMozuxg/w-d-xo.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: th-cam.com/channels/ivLavXhYn-Ap0IJcNMjmeg.html?view_as=subscriber
      HDProDesign Team

  • @AntonioToledoCGDEMOS
    @AntonioToledoCGDEMOS 5 ปีที่แล้ว +1

    Thank's This Tutorial, Was "VERY USEFUL"....

  • @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 :)))

  • @nikkuzmich5378
    @nikkuzmich5378 2 ปีที่แล้ว

    this is exactly what I needed

  • @meddie79
    @meddie79 6 ปีที่แล้ว +53

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

    • @sweftis8300
      @sweftis8300 5 ปีที่แล้ว +21

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

    • @TheRealMobiius
      @TheRealMobiius 5 ปีที่แล้ว +20

      @@sweftis8300 physic materials. ;)

    • @bartwestenenk6088
      @bartwestenenk6088 5 ปีที่แล้ว +8

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

    • @arsylgames
      @arsylgames 3 ปีที่แล้ว +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'

  • @Lukas-dz7oe
    @Lukas-dz7oe 4 ปีที่แล้ว +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 2 ปีที่แล้ว

      hell yeah exactly what I needed thank you(:

  • @madebymartins
    @madebymartins 3 ปีที่แล้ว +1

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

  • @mihaelgolob8739
    @mihaelgolob8739 4 ปีที่แล้ว

    Awesome tutorial man!

  • @suppressinglight1007
    @suppressinglight1007 3 ปีที่แล้ว

    you actually did this really good amazing thank you you are a cool dude

  • @robertsibek
    @robertsibek 3 ปีที่แล้ว

    Thanks for this perfect tutorial.

  • @tuncfreeman
    @tuncfreeman 3 ปีที่แล้ว

    Thanks for teaching us 👍🏼😎

  • @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.

  • @ComputerscienceByMalitha
    @ComputerscienceByMalitha 4 ปีที่แล้ว

    Thank you very much. No words to say.

  • @omega1543
    @omega1543 5 ปีที่แล้ว

    Best tutorial very easy to follow good guidance.

  • @stealthy17
    @stealthy17 4 ปีที่แล้ว +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

  • @virusblack3367
    @virusblack3367 4 ปีที่แล้ว

    thanks for teaching,you are good teacher

  • @_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

  • @bendixergamestudio4472
    @bendixergamestudio4472 3 ปีที่แล้ว

    Excellent tutorial!

  • @Motimen_sura
    @Motimen_sura 2 ปีที่แล้ว +1

    Best on ever i watched

  • @bibekgamebox1083
    @bibekgamebox1083 3 ปีที่แล้ว

    Very nice tut

  • @lucidjuice101
    @lucidjuice101 2 ปีที่แล้ว

    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.

    • @CurioseaTodo
      @CurioseaTodo 2 ปีที่แล้ว

      it doesn't work for me

    • @lucidjuice101
      @lucidjuice101 2 ปีที่แล้ว

      @@CurioseaTodo Is the car not moving?

    • @CurioseaTodo
      @CurioseaTodo 2 ปีที่แล้ว

      @@lucidjuice101 now works, thanks

    • @lucidjuice101
      @lucidjuice101 2 ปีที่แล้ว

      @@CurioseaTodo Cool, welcome

  • @Saksham0412
    @Saksham0412 ปีที่แล้ว

    Thanks a Ton Brother it worked :)

  • @romanbyy
    @romanbyy 2 ปีที่แล้ว +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

  • @courageouscuber9278
    @courageouscuber9278 3 ปีที่แล้ว

    Best tutorial ever!

  • @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.

  • @cptray-steam
    @cptray-steam 3 ปีที่แล้ว +3

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

  •  2 ปีที่แล้ว +2

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

  • @user-mi6vg2nw2f
    @user-mi6vg2nw2f 6 ปีที่แล้ว

    Thank you for what you are doing.

  • @danielmarton4388
    @danielmarton4388 4 ปีที่แล้ว

    Hello!
    This tutorial is amazing and it's really helpful, but i have a question.
    How can I make for example a wheelhub that positions and steers with the wheels, but it doesn't rotating?

  • @BharatAdhanaJustme
    @BharatAdhanaJustme 3 ปีที่แล้ว

    Awesome Job bro!!!!

  • @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 2 ปีที่แล้ว

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

  • @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?

  • @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?

  • @MuhammadShahid-co8yt
    @MuhammadShahid-co8yt 3 ปีที่แล้ว

    Amazing man

  • @usepro_usa
    @usepro_usa 2 ปีที่แล้ว +1

    Love You Bro

  • @diime02
    @diime02 3 ปีที่แล้ว

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

  • @dama897
    @dama897 3 ปีที่แล้ว

    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?

  • @muratkaplan7176
    @muratkaplan7176 4 ปีที่แล้ว

    awesome tutorial

  • @freddyhappy86
    @freddyhappy86 7 หลายเดือนก่อน

    excelente, muchas gracias!

  • @paritagojariya5300
    @paritagojariya5300 5 ปีที่แล้ว

    You saved me.
    Thank you...!

  • @tammyhall7977
    @tammyhall7977 4 ปีที่แล้ว

    Great tutorial.

  • @lukakion2978
    @lukakion2978 4 ปีที่แล้ว +2

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

  • @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

  • @Windstale
    @Windstale 3 ปีที่แล้ว

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

  • @nargesshakerian7946
    @nargesshakerian7946 8 หลายเดือนก่อน

    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?

  • @tahirciger8344
    @tahirciger8344 4 ปีที่แล้ว +1

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

  • @TheOneWithComments
    @TheOneWithComments 2 ปีที่แล้ว

    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.

  • @MontAureal
    @MontAureal ปีที่แล้ว

    Muito obrigado pelo tutorial, me ajudou muito. Sucessos na sua vida!!!!

  • @maheshreddy6266
    @maheshreddy6266 5 ปีที่แล้ว

    I am using another car but when I click on play button it just floats I added rigid body with 1500 mass but it still floats and keeps moving in random direction somebody help

  • @RivenbladeS
    @RivenbladeS 8 หลายเดือนก่อน

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

  • @DU5TCLAN
    @DU5TCLAN 3 ปีที่แล้ว

    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.)

  • @charlesdupouy
    @charlesdupouy 3 ปีที่แล้ว

    works perfectly !

  • @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

  • @Nenea__
    @Nenea__ 2 ปีที่แล้ว

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

  • @ashwinpuranik4845
    @ashwinpuranik4845 3 ปีที่แล้ว

    Thankyou so much

  • @CrazyWiz
    @CrazyWiz 3 ปีที่แล้ว

    Can we stop the car immediately after releasing input?

  • @relatableostrich2524
    @relatableostrich2524 5 ปีที่แล้ว

    Does anyone know a way to enter the car if you are using a first or third person controller?

  • @SoulBlessin
    @SoulBlessin 4 ปีที่แล้ว

    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?

  • @ff_iitrah9884
    @ff_iitrah9884 4 ปีที่แล้ว

    is this car have break function ?
    im sorry if i not recognize ..

  • @IGNACY-fp8zo
    @IGNACY-fp8zo 2 ปีที่แล้ว

    for some reason when I try the wheel colliders out they instantly fall off the vehicle and go forward hundreds of blocks at a constant speed
    any ideas of how to fix?

  • @nicholasbrave1
    @nicholasbrave1 4 ปีที่แล้ว

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

  • @SteelandSouls
    @SteelandSouls 3 ปีที่แล้ว +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 2 ปีที่แล้ว +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 2 ปีที่แล้ว

      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 2 ปีที่แล้ว

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

    • @albertoneto4781
      @albertoneto4781 2 ปีที่แล้ว

      @@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.

  • @TheRainHarvester
    @TheRainHarvester 4 ปีที่แล้ว

    How did the wheels know how to turn graphically?

  • @maalmicode4890
    @maalmicode4890 4 ปีที่แล้ว

    Thank you so much

  • @greenscreen369
    @greenscreen369 6 ปีที่แล้ว

    GOOD AND NICE WORK

  • @theemeraldfalcon9184
    @theemeraldfalcon9184 4 ปีที่แล้ว

    How can I change the direction the wheels rotate in?

  • @Gunbarrelguru
    @Gunbarrelguru 5 ปีที่แล้ว +10

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

    • @nischalkharel6852
      @nischalkharel6852 5 ปีที่แล้ว +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

  • @Michael-kl2un
    @Michael-kl2un 3 ปีที่แล้ว

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

  • @lawrencewang1417
    @lawrencewang1417 5 ปีที่แล้ว

    Where did you find the road mat

  • @bchshz
    @bchshz 2 ปีที่แล้ว

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

  • @piyushraj8839
    @piyushraj8839 3 ปีที่แล้ว

    Thanks a lot!

  • @mehmetsahin7313
    @mehmetsahin7313 5 ปีที่แล้ว

    thanks for tutorial. If you give information about whell collider specifics it would much better. Thanks for good tutorial

  • @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

  • @cptray-steam
    @cptray-steam 3 ปีที่แล้ว +3

    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.