I watched like 10 videos and finally the best one is here! Thank you, this is awesome!
@joshd42902 ай бұрын
man i was struggling trying to make my own car physics system, then i finally gave up to the wheel collider, thanks for the help dude!
@IanFord-e6w Жыл бұрын
Hey there, just wanted to drop in and say thanks for this. Recently started doing stuff in Unity and this tutorial was very well put together. Quick, to the point and super easy to understand.
@aneskaric11 ай бұрын
No complicating, precise and straight to the point! Thanks!
@b3agz11 ай бұрын
All the things I was aiming for! Thanks!
@joethewolf37505 ай бұрын
Thank you. Out of the ones I've seen, this tutorial seems the most fitting for my project and it's one of the simplest to do and understand as well. I think I'm gonna use it. It's really relieving to have found something I can work with because when I was given the task to make our car less janky, I was really stuck on how to do it. (At its current state, the car just goes sideways without turning when you press A or D so... It's dire and I didn't have much to work with.)
@nayefmsh8274 Жыл бұрын
Wow, this tutorial was actually helpful out of the millions of other videos I watched
@bigedwerd Жыл бұрын
You're a lifesaver. I was struggling with localEulerAngles unnecessarily for the wheel angle and this helped immensely.
@aminurrahmansamit80102 жыл бұрын
Thanks man. I was struggling with wheelcolliders a lot until I came across your video. well explained!
@rhakka3 жыл бұрын
Thanks, as always, for the great content!
@thesoulmonster Жыл бұрын
This is a fantastic video! I used this for my scooter, which has two wheels, and your video was so good and self-explanatory that I was able to make it work anyway.
@DOHCKSeries2 жыл бұрын
awesome tutorial, great job explaining what the code actually does in a beginner manner so it's easier to take in
@ivancarranza2473 Жыл бұрын
Woah !!!!! What can I say that's probably has not been said in the comments already? Amazing tutorial, so simple so to the point, so useful. Thanks a lot! I will be going through the rest of your youtubes to see what other amazing tutorials have been missing all my life. Thanks again.
@foreducation4084 ай бұрын
This tutorial is awesome, helped me a lot.
@TMosier882 жыл бұрын
If anyone is having trouble getting the car to move, try turning the mass down a bit. I'm using Synty assets and my mass is set to 200. I also adjusted Acceleration to 100 and braking force to 60 but I'll play with those values later on. Also, if anyone wants to use the new update system, just change the currentAccleration = acceleration * Input.GetAxis("Horizontal"); to currentAcceleration = acceleration * inputAction.YourActionMapName.YourVector2BindingName.ReadValue().y;
@katvivala8732 жыл бұрын
Hi Travis Thank you for that comment, I actually ran into this issue, the car is moving like a pudding. It hops a little bit forward, but it doesn't stay on the road and just move forwards. Do you have any other advice? I used mass 90, accelleration 100 and breakingForce 60. When putting mass down, then it moves upwards.. Also I wanted to ask you, what do you mean with the new update system? Actually I didn't used the asset from b3agz, I used another car with 4 wheels - much more simple than this one. But should work as well, shouldn't it? Many regards
@TMosier882 жыл бұрын
@@katvivala873 I meant the new input system, not update. Just a typo in my part. Without seeing your code, I couldn’t say what’s going on with your movement. But yes, another car asset should also work, I also used a different one
@katvivala8732 жыл бұрын
@@TMosier88 Thanks for replying. Well I used the same code as he did, but maybe there is something else wrong with rigidbody or colliders. I think my issue is, that the wheels are rolling in the wrong way.. the back one's are going backward and the front are moving in front. Do you maybe now how to change it? As the rotation didn't help I'm a little lost. Or maybe you, @b3agz ? Many thanks, Kat
@katvivala8732 жыл бұрын
Nevermind, hat an issue with my keyboard.... Thanks anyway
@tudougames8610 ай бұрын
Just found this, really helpful. Thanks a ton!
@StigDesign3 жыл бұрын
Moving takes great time and energy i moved too, in start of september, noe finished yett XD :D Nice to see you live still :D This is what i missed and Loved the explanation and showing+testing etc :D i hope you maby do more on this :)
@batuhanyldrm75326 ай бұрын
Great video sir, I'm trying to learn Unity and rn working on a low level MarioKart game, this is a huge help. Thank you.
@MYTHICALLY3D2 жыл бұрын
never watched someone explained it so well.
@signortomato55623 жыл бұрын
Nice tutorial. Thanks for the video ❤️
@elcoquilletos95243 жыл бұрын
very very very big thanks from France
@DerAua2 жыл бұрын
Wow, super simple in the explanation. Thank you.This skips a lot of the technical background but that makes it just right for a beginner.
@gamingbeast84172 жыл бұрын
Thankyou sooo much, searching a tutorial for 3 months and found yours! Lol, 1 new sub!! :)
@jeremynunns74962 жыл бұрын
This was great - everything I needed although I wanted to learn how to create a following camera as well.
@kaylexi88792 жыл бұрын
Hey its hard to explain but if you look at some tutorials to add a virtual camera machine its pretty simple and you can have the camera follow your object etc
@jeremynunns74962 жыл бұрын
@@kaylexi8879 thanks! Yeah i was looking more at a “smooth camera” - but there are tutorials for that as well so all good!
@jeremynunns74962 жыл бұрын
@@TheGreatSlayman Thanks, although I was thinking more on the lines of a delayed camera follow - like a smooth drone flying behind it.
@dreamescence2 жыл бұрын
Awesome, simple and precise! great tutorial! Cheers mate!
@skourge891 Жыл бұрын
For anyone struggling with the car moving really slow or not even budging (especially for Synty Asset Cars) play around with the wheel collider Y position and radius in game mode, I noticed if it is too large of a radius and or too low to the ground it causes the car to not move. Hope this helps :)
@gabbargamer2007 Жыл бұрын
If it is slow then can't we just increase the acceleration???
@skourge891 Жыл бұрын
@@gabbargamer2007 it was a matter of the wheels not properly colliding with the road, so the wheels would spin but the car wouldn't move, from memory.
@gabbargamer2007 Жыл бұрын
@@skourge891 Then I think u used reduce the size of the collider, I mean if t radius of the cars wheel is let just say 8 then use collider a litter but smaller than that, only a little bit so that it doesn't stuck in ground and also make sure to merge the movement of collider and mesh
@skourge891 Жыл бұрын
@@gabbargamer2007 Yes, so in my original post, that's why I said to play around with the collider in game mode. Has nothing to do with the acceleration.
@gabbargamer2007 Жыл бұрын
@@skourge891 Sry i thought u were talking about the speed of car 😅
@gabrielwhite98813 жыл бұрын
@b3agz great to see u back. i'm looking forward for more interesting and helping videos.
@shiyamprasad32132 жыл бұрын
Thank you so much man. It was a great one
@TinyCastleGames2 жыл бұрын
Great Tutorial. really easy to follow
@__m.nikolov__6 ай бұрын
why tf the stupid wheel collider is always not in the correct orientation and why it couldn't be rotated? the wheel is always facing the collider by its side and it can't be rotated
@sabmis265814 күн бұрын
Has to do with the orientation of the car. You can take it in to Blender, rotate it facing the y axis.
@shotakhakhishvili91862 жыл бұрын
Amazing tutorial, thanks a lot!
@Strange-y3t Жыл бұрын
thank you so much for this tutorial it helped me sooooo much!!!!
@phantomneon14603 жыл бұрын
I have started influencing his vid ideas, soon I will be influencing his major decisions, soon I will take over this channel... all a part of the plan... he... he... he......
@BirshanRamzyCaraccio2 жыл бұрын
Finally.. a gpod tutorial.. thanks. Could u make a motorbike tutorial aswell? Nothing fancy (no need for humans).. i just wanna know how to get the bike to turn left and right and move forward
@timurredkin3846 Жыл бұрын
Brilliant video, thank you
@b3agz Жыл бұрын
Glad you enjoyed it
@antoinemaes2 жыл бұрын
Best video on the topic ! Thank you very much !! Although I didn't click on it at first, thinking it might not talk about wheel colliders...
@TheSkyGuy77 Жыл бұрын
My wheels, as soon as i finished the code for wheel mesh rotations, went sideways. Why?
@jeffinjoseph8916Ай бұрын
Sigh the same happened to me
@networkserpent51552 жыл бұрын
you should keep making videos, this was very helpful for a beginner!!
@onskuponsku_11eo2111 ай бұрын
this was really helpful
@b3agz11 ай бұрын
Great to hear!
@gabrielepstein87869 күн бұрын
Awesome video, super helpful. I'm new to Unity, any advice/direction for how to get my third person controller character to 'enter' the car - i.e I interact with the car and then I control the car instead of the character, who now sits in it.
@thomasaleva Жыл бұрын
Thank for the great video! Helped me to get started very well. Issue I have is that when I place the wheel colliders and press Play, the wheels of my car-model change position (they move outwards a bit and the tire&rim, which are two separate assets, are disconnected. Any idea what the issue is and how to fix this? I can share some screenshots, but don't know how to share in YT comments..
@nunusvenus7945 Жыл бұрын
same issue here
@tobario2 жыл бұрын
Very useful, thank you!
@maximegermain-montminy5884 Жыл бұрын
hey i have an issue everything is good but my SerializeField does not Serialize and i dont know why it doent highlight
@baiphophudthida41282 жыл бұрын
This tutorial is safe my life from my project at the university, but i have some question for a bit. how to increase speed of the car?
@funfactorytime2 жыл бұрын
you can change it from the Inspector of the object the Script is linked to.
@martinvanstein.youtube Жыл бұрын
great video !!!
@TotallyNotInspired3 жыл бұрын
You could do a tutorial on a custom wheel collider, there isn't a good one about that
@wellpdoclube3 жыл бұрын
THX from Brazil
@RocketLabratory Жыл бұрын
Hello, I’m around seven minutes in and have an issue regarding the wheel colliders. When I connected the wheel colliders to the serialize field my error said that wheel collider does not contain definition for ‘breakTorque’. Any help would be appreciated thanks. Nvm spelled brake wrong in the script. Jeez that was a headache lol
@tennli018 ай бұрын
You are a god to me!
@junaid70402 жыл бұрын
Thanks bro thank you very much 😘😘
@parthacodes5893 Жыл бұрын
Thanks i wnated the fomula for the speed up of the car
@pengchengzhang1661 Жыл бұрын
A wonderful video.But when i dirive the car on an uneven surface,the car is too easy to flip over,do you have any ideas?
@artandmusic51910 ай бұрын
I think you need to look into the suspension and how they work in cars - then try to build your own although it might be complex
@foxkiller41 Жыл бұрын
thank you magic man
@kpm25 Жыл бұрын
thanks for your video. The approach I need to take (for an assignment) is to make a two wheeled vehicle (like a box with wheels on left and right). Would this method work?
@MrMattyMoses Жыл бұрын
this is awesome! thank you so much for making this. it was so cool seeing my car basically come to life thanks to your video. The only thing I'm struggling with is getting the car to move any faster? I've bumped up the acceleration to 5,000 and it barely speeds up. I dropped the mass down to 500. All of the wheels are spinning the correct way. Anyone find a fix for this? I saw someone else in the comments say their car was moving like it's in pudding. That's where I'm at. Once I fix this I'll be in the clear.
@brandon_bsbl77322 жыл бұрын
Hello! Thank you for the tutorial. I am having trouble with the mesh attaching to the collider, the wheels are connected , but they are rotated 90 degrees compared to how they should be. Is there a fix to this?
@finvanwyk12442 жыл бұрын
Hi, did you get any answer to this?
@finvanwyk12442 жыл бұрын
Hi, I managed to fix mine. I had to APPLY the rotation on my cars wheels in blender so that all of them where 0, 0, 0. After that I exported it to unity and it was fixed.
@andriatsiklauri57572 жыл бұрын
Good Job! :)
@alicanbayari Жыл бұрын
Im new in gameDev and My car is going reverse lmao but thank you man.
@primoscarab5771 Жыл бұрын
Great tutorial Just one question. How can I set a maxspeed for the car?
@finnkleinbrinke9062 Жыл бұрын
Thanks man! Only issue what i have is that my car (own model) goes slighty to the left when i go forward (havent messed with the left/right movement)..
@R4Zzvy144 Жыл бұрын
Hi,I just tried this and works very well but I have a problem,when I press W it goes back and when I press S it goes forward(I put all the colliders right)
@b3agz Жыл бұрын
It sounds like the input had gotten mixed up. When you convert the player input to vehicle force, stick a - before the value so it reverses it.
@R4Zzvy144 Жыл бұрын
Thank you,it was the car's problem,I changed it and now it works
@Nerdathon7 ай бұрын
Hello b3agz, when i set up my wheel meshes to follow the wheel collider, they went far off to the side and when they are rotated they go in a large circle, please help!
@Nerdathon7 ай бұрын
nvm, fixed it myself!
@b3agz7 ай бұрын
Sorry I didn't see this quickly enough. Glad you fixed it though!
@FonsDevАй бұрын
@@Nerdathon how i have the same problem
@tamasszenasi30992 жыл бұрын
I have the same car, same settings, same code and the car is not moving at all. anybody? Mass 1000, wheel collider's radius is much smaller because the model's size I want to use is smaller. What could be the issue? I have already tried to move another car with wheel colliders and did not move at all. Two cars did not move. I have no idea what is wrong.
@ronjamiehling80952 жыл бұрын
Do you found a solution? I have the same problem..
@mike1hav Жыл бұрын
Have you made sure you have a rigidbody on the car? It will not move without a rigidbody
@crazycarsim3 жыл бұрын
nice tutorial pls make another video on how to add mobile controlls (touch )
@elysian46202 жыл бұрын
I had no idea that Tom Hardy knows how to make games lol. great video man keep it up.
@jannahconsortium45212 жыл бұрын
At 7:44, how did you add the properties (Front Right, Front Left....) to the Wheel Controller (Script)? When I dragged the WheelController script to the inspection, I couldn't see these properties in mine. I'm stuck here
@jannahconsortium45212 жыл бұрын
I figured it out. I had issues with my code and it was not compiling successfully. the properties are showing now. thanks
@b3agz2 жыл бұрын
Sorry, just saw this. Glad you figured it out!
@inlo39482 ай бұрын
@@jannahconsortium4521what was your problem because my code won’t show up the wheels either
@JoshEllis3979 ай бұрын
im not sure if i will gte help but my car is tilting side to side as i turn and im wondering if anyone can help as i cant work out why
@SirCuddlesWorth Жыл бұрын
How would you go about making the steering wheel match the steering?
@BlackFlameBoss2 жыл бұрын
First of all, thank you for this video. It's well done. But I have a problem. Everything seems to work fine except that my wheels rotate in big circles around their axis rather than just rotate around their own axis. Any idea how to fix this? I think this is probably an issue within blender rather than unity maybe?
@allblakesmusic16062 жыл бұрын
I have this problem too have you fixed it?
@BlackFlameBoss2 жыл бұрын
@@allblakesmusic1606 yeah, had to adjust the origin of the wheels. I had it in the center of the car, so I adjusted it to the center of the wheel itself and reimported the model. Worked for me.
@skycheck70710 ай бұрын
I have the same problem too. How did you set the new origin?@@BlackFlameBoss
@BlackFlameBoss10 ай бұрын
Select a wheel, go to object → set origin → Origin to geometry. I did this in blender (where I originally made my car model)@@skycheck707
@testtest-ku7md10 ай бұрын
everything's fine, but while driving forward the car go slightly left or right. how to fix it?
@kingdoom19062 жыл бұрын
Thank you
@Dreojs_NL2 жыл бұрын
my wheel meshes ceep snapping on the wrong axis how do i fix that the code works because it worked on other wheels when i tried but the wheels im trying now keep snapping to the wrong axis
@Kvarget2 жыл бұрын
Been following the exact same steps, wheels' location and rotation is 0,0,0 and applied in Blender. Unpacked the mesh. Wheels keep floating 2 meters or so next to where they are supposed to be after I add the UpdateWheel function. I just can't figure out where this bs is misbehaving from :( Other than that, good vid!
@kyleconrad9861 Жыл бұрын
Same 😔
@TheDznation3 жыл бұрын
Now how can I do this but with buttons like a mobile racing game
@eagle97178 ай бұрын
Hey Quick Question, when you release the up or down keys, the car still stays the same speed, which makes sense, since you only control the acceleration and not the speed. Is there a way to make the car loose speed when the buttons are released? Thank you very much for the video, it really helped me out!!
@UltimateVenom848 ай бұрын
have you tried adding a small amount of drag to the Rigidbody?
@Sharkzy_9 ай бұрын
hello i have a issue where my car model doesn’t actually turn it just slides in the input direction, what could caused this?
@b3agz9 ай бұрын
Best guess would be the mass/friction values of your physics objects. Maybe try making your vehicle heavier and see if that changes anything.
@jannahconsortium45212 жыл бұрын
Awesome can I use the same method for oculus quest controllers instead of keyboard?
@b3agz2 жыл бұрын
The mechanics will work the same yeah. You just need to swap out keyboard input for some kind of oculus control. I believe you can get direct axis info from the touch controllers but prob wouldn't be very intuitive if you didn't do something a little more fancy.
@DinciAnimation Жыл бұрын
plz man tell me bro how can i just make a ui button witch rotate my car backward and forward
@Elsidu3 жыл бұрын
Hi! Thank you for your great work on that tutorial. I have a question - How to deccelerate when verticals are not pressed. Cuz if I press W for like 2 sec car is still running and won't stop. Any advice? Should I add if statement and apply break force if not pressed?
@Elsidu3 жыл бұрын
Ok. It's not that case. I've noticed that even doe I'm not pressing W or S the wheels are still spinning round and round. I guess it has to do with friction but for now I can't setup that right...
@Elsidu3 жыл бұрын
Ok! I got it!! It's Wheel dumping rate! I had to take it much higher. The higher you get it, the faster you will stop.
@sachinbhandari4143 жыл бұрын
@@Elsidu I was looking for the solution and here u are solving your own issues Awesome!!
@edmashokmusic1692 Жыл бұрын
my car doesn't climb properly in inclined plane. plz make a video on it
@SirCuddlesWorth Жыл бұрын
When I add the Wheel Collider, and shrink it to fit, it's always off center? + is 0 and the wheel collider is way below center.
@toutom66124 ай бұрын
i know this is late, but its the suspension distance. i had the same issue but thankfully worked it out after a while
@thenamescraft95278 ай бұрын
Great tutorial! Works great until I add the visuals to the wheels. The car literally does a flip and doesn't work after that.
@Poylman2 жыл бұрын
Hello! i tried putting the wheels on the new game object we created but it says that i cant move children of a prefab...Do you know how i can fix that?
@junaidjamshed81042 жыл бұрын
Hey select your whole car parent object right click and then go under prefab and click on Unpack completely
@kyleconrad9861 Жыл бұрын
I’m following fine until we add rotation to the wheels. The wheels float well outside the car and spin in big circles to the side, as though they’re orbing the car or rotating around another axis as opposed to in place. Not sure what to do with it, all my code matches up.
@kyleconrad9861 Жыл бұрын
For anyone with my issue or a similar one, it’s related to the pivot point of the wheels. I downloaded an asset where all 4 wheels picot around the center of the car, not the center of each wheel. You can fix this by changing the pivot of each wheel. 👍
@omiorahman62833 жыл бұрын
car flipping over are nightmares (as it was 4 years ago) is it depedent on my suspension and dampers
@beqasamadalashvili9058 Жыл бұрын
Nice tutorial but my tires are out of the car im using same asset
@b3agz Жыл бұрын
Try creating an empty game object for each wheel and having the code reference the empty object instead of the wheel directly. Then make your wheels children of the respective empty objects and set their local position so they're in the right place.
@shroudoodle2 жыл бұрын
what if i want to go my car only in forward direction without pressing anykey ? can u help
@b3agz Жыл бұрын
If you just wanted it to go forward all the time, remove the if statement where we check for the player pressing the acceleration button and have the code inside just be called every update.
@shroudoodle Жыл бұрын
@@b3agz thank you ♥️
@klewyk2 жыл бұрын
I would like to ask, how do i make the car drift?
@mach16yes Жыл бұрын
thanks bruh
@Kieranmcm07 Жыл бұрын
What if my object is grouped in which cant be ungrouped?
@b3agz Жыл бұрын
Not a lot you can do with that, unfortunately. You can either have the "wheels" be invisible and unconnected to the card (there won't be any visible spin or turning though) or you can crack open Blender and try and separate the wheels. Or use a different model.
@15690asdfg Жыл бұрын
I'm having an error so far: Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported since Unity 5. If you want to use a non-convex mesh either make the Rigidbody kinematic or remove the Rigidbody component If I check the "Is kinematic" box the car doesn't fall anymore. What do?
@mattg1345 Жыл бұрын
On a mesh collider make sure the convex tick box is checked and this will go away
@15690asdfg Жыл бұрын
@@mattg1345 hey, thanks for the response
@Ryuga_0193 жыл бұрын
Thanks❤️
@este_marco Жыл бұрын
i can't rotate the wheel colliders so my car goes sideways. can someone help??
@SlayerIoannis Жыл бұрын
is there a away to do it without a script?
@apinoita Жыл бұрын
I have a problem where the wheel meshes are spinning sideways and i tried turnig them and it did not work.
@apinoita Жыл бұрын
never mind fixed it by rotating the origin
@masuz3972 Жыл бұрын
@@apinoita i have the same problem you had. what is the 'origin' you rotated?
@koala4490 Жыл бұрын
I keep getting an error saying that there is no definition for 'breakTorque'
@caseycbenn5 ай бұрын
This is because he used "break" in a lot of his spelling BUT when calling the application's variables he HAS to use "brakeTorque" NOT "breakTorque" and hence the error when making a call to the physics system.
@Tirakisu2 жыл бұрын
Hi there ! Trying to follow this as a very first Unity tutorial and I would have loved just a little more basics stuff ! I'm actually struggling to import the car properly into Unity. I don't have all your folders, the wheel meshes and all that and I can't find them in the car folders as well
@darshr73202 жыл бұрын
Car doesn't move please help anyone fixed this issue
@qaasimrehan32392 жыл бұрын
same here its not moving did you get a fix?
@slinkalot3692 жыл бұрын
When I Stear My Car It Just Falls Over How Can I Fix That ???
@b3agz2 жыл бұрын
Best guess would be the mass of your car is too low. Try bumping it up to see if it helps
@protonproductions Жыл бұрын
Can the car climb slopes?
@Linuxo6193 Жыл бұрын
No
@bahamafarmer29142 жыл бұрын
Very nice video, saved me a lot of time! I guess physically more correct would be to call the variable "accelerationForce" instead of just "acceleration"?
@b3agz2 жыл бұрын
Yeah, naming variables has never been my strong suit.