Unity3D How To: Driving With Wheel Colliders

Поділитися
Вставка
  • Опубліковано 14 жов 2024
  • ⭐ 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/g...
    Download the project!
    github.com/cod...
    Vehicle used from the asset store.
    assetstore.uni...
    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 років тому +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 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

  • @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 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 5 років тому +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...

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

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

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

  • @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 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 4 роки тому

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

  • @karthuslin4005
    @karthuslin4005 2 роки тому +1

    It helps with my graduation project a lot.Thanks

  • @kishantakoordyal
    @kishantakoordyal 4 роки тому +2

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

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

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

  • @M0TYSHIZ
    @M0TYSHIZ 5 років тому +21

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

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

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

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

  • @alexandreamiel1865
    @alexandreamiel1865 3 роки тому

    best tutorial for wheel colliders, physics working fine

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

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

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

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

  • @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 ua-cam.com/video/oYlMXMozuxg/v-deo.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: ua-cam.com/channels/ivLavXhYn-Ap0IJcNMjmeg.html?view_as=subscriber
      HDCarController Version 2 will be on asset store soon.
      HDProDesign Team

  • @0ernij0
    @0ernij0 2 роки тому

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

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

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

  • @TheGrimmy
    @TheGrimmy Рік тому

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

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

  • @FoXcodeZ
    @FoXcodeZ 3 роки тому

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

  • @madebymartins
    @madebymartins 3 роки тому +1

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

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

  •  3 роки тому +2

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

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

  • @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 ua-cam.com/video/oYlMXMozuxg/v-deo.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: ua-cam.com/channels/ivLavXhYn-Ap0IJcNMjmeg.html?view_as=subscriber
      HDProDesign Team

    • @andrewnattress
      @andrewnattress 2 роки тому +2

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

  • @digitalpanda5969
    @digitalpanda5969 Рік тому +1

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

  • @lukakion2978
    @lukakion2978 4 роки тому +2

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

  • @abhinoorsingh3770
    @abhinoorsingh3770 2 роки тому +1

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

  • @tahirciger8344
    @tahirciger8344 4 роки тому +1

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

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

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

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

  • @Gunbarrelguru
    @Gunbarrelguru 6 років тому +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

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

  • @the_pachu4953
    @the_pachu4953 5 років тому +2

    One of the most useful tutorial so far!

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

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

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

  • @Motimen_sura
    @Motimen_sura 3 роки тому +1

    Best on ever i watched

  • @logsi647
    @logsi647 5 років тому +4

    Can someone help me? My car doesn't drive! I did the same thing as you but it won't move. I put down the scaling but still no movement

    • @pruthirajswain9861
      @pruthirajswain9861 5 років тому

      Did you found any solution ?

    • @logsi647
      @logsi647 5 років тому

      @@pruthirajswain9861 Not yet

    • @linusreimertz2850
      @linusreimertz2850 4 роки тому +1

      Does your wheels spin? I had a problem with my wheel colliders not being in contact with the ground due to thier small size and the size of my box collider.

    • @anshupal1199
      @anshupal1199 4 роки тому

      @@linusreimertz2850 my wheels are spinning but then also i am unable to make the car move

    • @linusreimertz2850
      @linusreimertz2850 4 роки тому

      @@anshupal1199 are your box colliders in contact with the ground? My car was resting on the bottom plate before I increased the size of them. Try to make the pretty big just to check. Otherwise I have no clue, havn't worked on that project for quite some time

  • @Lormax23
    @Lormax23 4 роки тому

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

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

  • @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 4 роки тому

      lower the mass of the wheelcolliders

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

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

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

  • @YarinZit
    @YarinZit 2 роки тому

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

  • @DimeF1
    @DimeF1 3 роки тому

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

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

  • @MrSansibaer
    @MrSansibaer 2 роки тому

    Great Tutorial ! Very clear & clean coding!👍

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

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

  • @CrazyWiz
    @CrazyWiz 4 роки тому

    Can we stop the car immediately after releasing input?

  • @mhausage3454
    @mhausage3454 4 роки тому +1

    Someone pls help me. My wheels start turning 90 degrees whenever i play it.Its like the car wanna go for a ride at the bottom of the oceon. how to fix this?

  • @Nenea__
    @Nenea__ 3 роки тому

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

  • @nikkuzmich5378
    @nikkuzmich5378 3 роки тому

    this is exactly what I needed

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

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

  • @bchshz
    @bchshz 3 роки тому

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

  • @mysteryguy7716
    @mysteryguy7716 3 роки тому

    The tutoriol is the best. But the car you choose have in real live a 4 wheele drive.

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

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

  • @ironnokana6760
    @ironnokana6760 4 роки тому

    I have followed your instruction but the getaxis didn't received any input but I admit that this tutorial is a bit simple.

  • @changshuaiwang8966
    @changshuaiwang8966 3 роки тому

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

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

  • @X_Daniel466
    @X_Daniel466 5 років тому

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

  • @Maggiethegsd
    @Maggiethegsd 3 роки тому

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

  • @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 2 роки тому

      @@arshigupta9076 Worked for me, thank you!

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

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

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

  • @beauvance11
    @beauvance11 5 років тому

    I have an issue with my vehicle....the wheels are turning like paddles...not spinning...nor is it moving....ant the steering is acting like the runner from borderlands 1......sliding left and right not like normal cars...I feel I missed something important

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

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

  • @wullum8902
    @wullum8902 5 років тому

    your mentioned camera movement being jittery with FixedUpdate() and LateUpdate(). you might get better results using regular Update() using * Time.deltaTime , so you aren't catching the movement at an unnatural place because your framerate isn't synced with the timing of FixedUpdate.

  • @tuncfreeman
    @tuncfreeman 4 роки тому

    Thanks for teaching us 👍🏼😎

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

  • @Motimen_sura
    @Motimen_sura 3 роки тому

    In which key this car moves plz reply

  • @pitbullturtle
    @pitbullturtle 4 роки тому

    Somehow the wheels go up in the air when i press play but the center of rotation stays, so the wheels rotate in a big circle around the axle. The wheels doesnt want to "collide" with the ground either and just go straight through the ground. I used my own model with the wheels already attached as children, is there anyone out there who knows what might be wrong? Great tutorial btw, really liked it!

  • @EliteCubingAlliance
    @EliteCubingAlliance 3 роки тому

    Best tutorial ever!

  • @eddnufc93
    @eddnufc93 5 років тому

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

  • @TouringRCs
    @TouringRCs 4 роки тому

    If you don't select your project to be made with the ”Extras”, do you still get these nice graphics?

    • @DamanD
      @DamanD 4 роки тому

      Well yes, but actually no. You need to import postFX and set them manually. There are a lot of tutorials on this

  • @petergrosch986
    @petergrosch986 4 роки тому +4

    I'm using a model i created instead of the asset used here, and everything works fine until I add the wheel colliders, which come in rotated 90 degrees. Will this effect how the wheel turns? And if so, does anyone have a fix?

    • @JanTuts
      @JanTuts 4 роки тому +1

      Just rotate your wheel model 90 degrees to fit the orientation of the wheel collider in your 3D software and export again.

  • @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 5 років тому

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

  • @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 ua-cam.com/video/oYlMXMozuxg/v-deo.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: ua-cam.com/channels/ivLavXhYn-Ap0IJcNMjmeg.html?view_as=subscriber
      HDProDesign Team

  • @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 ua-cam.com/video/oYlMXMozuxg/v-deo.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: ua-cam.com/channels/ivLavXhYn-Ap0IJcNMjmeg.html?view_as=subscriber
      HDProDesign Team

  • @ComputerscienceByMalitha
    @ComputerscienceByMalitha 4 роки тому

    Thank you very much. No words to say.

  • @bellanurhaliza5471
    @bellanurhaliza5471 3 роки тому

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

  • @betterthan99o
    @betterthan99o 3 роки тому +1

    Love You Bro

  • @bibekgamebox1083
    @bibekgamebox1083 3 роки тому

    Very nice tut

  • @TheRainHarvester
    @TheRainHarvester 4 роки тому

    How did the wheels know how to turn graphically?

  • @nicholasbrave1
    @nicholasbrave1 4 роки тому

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