As much as all the information is there and it's fantastic to use. Please remember this is a tutorial; not a speed run.
@hawkgamedev2 жыл бұрын
there is also "Playback Speed" and "pause the video" you know ...
@T0MM0-Lds2 жыл бұрын
@@hawkgamedev wow thanks! Never knew that was there! ❤️ Pillock
@hawkgamedev2 жыл бұрын
@@T0MM0-Lds you are welcome poor fish.
@himanshuVisuals2 жыл бұрын
my car dont turn left and right
@hawkgamedev2 жыл бұрын
@@himanshuVisuals hey man share in your discord I'll help you.
@Massive-3D3 жыл бұрын
I was so afraid to scroll down and see "video upload date: 5 years ago" Subscribed!
@uniquelyrics23313 жыл бұрын
lol
@matheusmartins31773 жыл бұрын
me too LOL
@monkeyrobotsinc.98753 жыл бұрын
i HATE that.
@SajeehSamad3 жыл бұрын
lol
@RandomNovaGames4 жыл бұрын
Maybe the first video that I have seen that teaches you to create a nice car handling for free. Good place for me to start. Others dont handle well at high speeds
@3bomb2 жыл бұрын
Just a quick heads up, this script is using negative motor torque to handle braking when pressing "S." Per Unity's documentation, negative motor torque should not be used for braking. If you'd like to apply brakeTorque instead of negative motorTorque, create an if statement that says if verticalInput < 0 then brakeTorque = -verticalInput * brakeForce.
@vilmerforsberg Жыл бұрын
in which part of the scrpit should you put this? btw i really liked your car video:)
@luiss.20053 жыл бұрын
I really like this tutorial because you show some common mistakes and how to avoid them. For example: setting the box collider incorrectly or using Lerp insead of SmoothDamp. Unity is not a black box where you input the correct values and everything works just fine. Making games (or anything, really) is iterative. I think showing the process can be very encouraging for beginners.
@joooosl3 жыл бұрын
What did you use in HandleRotation? There is no SmoothDamp
@luiss.3866 Жыл бұрын
Are we brothers?
@carolineyonatan2164 жыл бұрын
Lol i see this ad while watching dani
@swastikmishra88224 жыл бұрын
Same bro
@vvixell14 жыл бұрын
same
@neongreggyyt11154 жыл бұрын
Same
@suanzalal4 жыл бұрын
Ah. I see you're a Boner aswell.
@youdaily71134 жыл бұрын
Ssssssnanananana same
@rubenopenworld84054 жыл бұрын
I mean yes you are doing things and i guess it works for experienced users of unity but you should explain more why you would do certain steps, idk when i would try this for some other thing i would not remember how to do it
@nahiyanalamgir70563 жыл бұрын
Agreed. I think the main problem is that these tutorial producers write code continuously without running the game to show the results at every step. Instead they probably just write the entire code at once before making the videos and copy every line from there, explaining each line lightly.
@monkeyrobotsinc.98753 жыл бұрын
im somewhat experienced and i still had to pause the video every 2 and a half seconds to catch up with the typing. hes crazy.
@dradex95623 жыл бұрын
@@monkeyrobotsinc.9875 you know he sped up that part right????
@samochreno3 жыл бұрын
@@monkeyrobotsinc.9875 you have to be kidding, if youre somewhat experienced you should be able to catch up with this easily
@axer10153 жыл бұрын
Man only problem is YOU GO TOO FAST! GO SLOWER!
@1agent3LT3 жыл бұрын
yea
@jorande1e2 жыл бұрын
The pause button exists
@WajiD_xD2 жыл бұрын
Or just leave the world
@Rodehaas2 жыл бұрын
0.5x speed?
@counterpointerz-rocketleag20383 жыл бұрын
thanks, you guys will definitely need to do some research about the different things he did, but coding is all about teaching yourself
@bopark1783 Жыл бұрын
This is really awesome video for newbie! Everyone in the youtube just skips parts of how to setting up the objects and not fully explain how each code works. But this video is really kind to explain how to take each steps!!
@markpolak86224 жыл бұрын
You are missing the brakek force reset, the if(isBraking) {applybreak()} is wrong because, the 0f breakforce never applies, it means once you braked the car just stops and cant go anywhere, you shoul always apply the bake
@jacobpatron83873 жыл бұрын
@PRANAY G.V. Inside the HandleMotor() function you could add this code to fix that bug, you may have already figured out a solution but hopefully it can at least help someone else. Basically, this code checks if isBreaking is false, if it is it sets the brakeTorque for each wheel to 0. if (!isBreaking) { frontRightWheelCollider.brakeTorque = frontLeftWheelCollider.brakeTorque = backRightWheelCollider.brakeTorque = backLeftWheelCollider.brakeTorque = 0f; }
@MrLiam1113 жыл бұрын
@PRANAY G.V. Just remove the IF from the ApplyBreaking method
@rahulprasad89063 жыл бұрын
@@jacobpatron8387 thank you!
@tejaskale68233 жыл бұрын
@@jacobpatron8387 thankyou soooo much dude
@bamers4043 жыл бұрын
@@jacobpatron8387 thanks 🙏
@joshuastoddard3556 Жыл бұрын
Super Helpful!!! By the way if you make the engine to powerful it the car will flip. I made a little script to fix that though. Script: using System.Collections; using System.Collections.Generic; using UnityEngine; public class Flip : MonoBehaviour { void Update() { if (Input.GetKeyDown(KeyCode.V)) { transform.rotation = Quaternion.Euler(0, 0, 0); } } }
@lawrenceredmacher43822 жыл бұрын
I've found that changing suspension spring target position to 1 makes the car basically unable to flip over. or change it to 0 to make it super easy to flip :D
@nikkuzmich53783 жыл бұрын
Great tutorial! I did the same with my car, but I had one strange problem: my wheels do not rotate around themselves, they rotate in a circle with a certain radius... I solved this by creating empty objects in the same place as wheels, and used them as transforms. But I think this is not an ideal solution, as in a collision the wheels are raised... and not lowered.
@hdprodesignteam2312 жыл бұрын
Hi Niaz. Check this links: Hope helps. kzbin.info/www/bejne/fIfZXpt7l6mEd8U kzbin.info/www/bejne/fZ3EoJyQbZV-mbc Playable Demo : drive.google.com/file/d/1_JnQSfTP8E7EfKZhJVdClohhxBQ7cgei/view?usp=sharing Kindly waiting for your comments to improve it. Thanks.
@forgodsakejake2 жыл бұрын
i had the exact same issue, was trying to find a solution for so long so thank you for this
@vincenthornak74692 жыл бұрын
@@forgodsakejake I am still confused on how they got this working... I am having the exact same issue. Any tips?
@gglobensky2 жыл бұрын
It's because the pivot point of the object is not in the center. Just parent the mesh onto a gameObject with the right pivot and move all the scripts to the empty parent you just created.
@bowl18582 жыл бұрын
Good tutorial, one question. When I start moving my car, once it gets to a certain speed it starts jittering side to side really quickly and leans to the left. My wheels are all at the same y axis, and tinkering with the settings is doing nothing. How do i fix this????
@Rikko2303922 жыл бұрын
I have same problem
@Jimblesnitronbo2 жыл бұрын
I had the same problem too, but whenever I change the mass in the car's "Rigidbody" component, it fixes it! Hope this helps!
@tonyhamilton77853 жыл бұрын
This is hella advanced. All I need is to make the car turn left & right when moving
@saiyanpridezbudokitenkaich34443 жыл бұрын
Its not advanced if u understand c# but this guy speaks faster than 6000 MotorTorque
@BerzahMusic3 жыл бұрын
lol
@bamers4043 жыл бұрын
Then a car game is not for you. Because it's all bout physics
@tonyhamilton77853 жыл бұрын
@@bamers404 Not really. I learned a lot over these months. Even the best programmers have to google how-to and error videos. Its all about following instructions to know how to do it in the future. I made a car game and got it working, but I scratched it for other ideas
@FelineRaptor-gv4te3 жыл бұрын
If you want it so simple without proper physics, then try this- using System.Collections; using System.Collections.Generic; using UnityEngine; public class MyCarController : MonoBehaviour { public float maxSpeed = 30f; // Our maximum speed allowed. public float curSpeed; // Current Speed; public float applySpeed = 20f; // How much force to apply (Forward). public float brakeForce = -10f; // Breaks. public Rigidbody myRigid; // Our Rigidbody. public int turnAmount; void Start() { myRigid = GetComponent(); // Gets the players Rigidbody. } void FixedUpdate() { curSpeed = myRigid.velocity.z; if(curSpeed >= maxSpeed) { applySpeed = curSpeed; } if(Input.GetKey(KeyCode.UpArrow)) { //Apply Accelleration myRigid.AddRelativeForce(Vector3.forward * applySpeed); } if(Input.GetKey(KeyCode.DownArrow)) { //Apply BREAKS myRigid.AddRelativeForce(Vector3.back * brakeForce); } } void Update() { if(Input.GetKey(KeyCode.A)) { transform.Rotate(Vector3.up * -turnAmount * Time.deltaTime); } if(Input.GetKey(KeyCode.D)) { transform.Rotate(Vector3.up * turnAmount * Time.deltaTime); } } This wasactually a script for flying a plane in a post in Unity Answers but I tweaked the script to make it a car controller. Just remember to add a rigidbody [with mass 1] to your car GameObject and a box collider with a suitable size and position. Any problem wiht the script, ask me.
@TheEdugato1003 жыл бұрын
im a simple beginner, i just want my cube to move...
@froosx94183 жыл бұрын
well that's pretty easy i can actually send u the script if you'd like
@isaiahcancode26493 жыл бұрын
@@froosx9418 please show me
@isaiahcancode26493 жыл бұрын
nvm i already know how to
@DARK_AMBIGUOUS3 жыл бұрын
Use bolt and then open the flow graph and make ad a thing called “on keyboard input” and then add a “position translate” thing and then make it so everyone you press W it moves the cube 1 on the x axis, and do the same thing with S but make it move -0.5 or -1 and then add a rotation translation thing and make it so it rotates 1 on the Z axis when you press A
@gamer-revolution3 жыл бұрын
ok i am just like dani i only copy tutorials and not learn
@monkeyrobotsinc.98753 жыл бұрын
really cool that this worked, thanks, but i just used cinemachine for the follow camera.
@FelineRaptor-gv4te3 жыл бұрын
yeah, it would be more flexible actually because you can customize the value and get any behaviour you want. Also the cam look script in the video is not very comfortable while steering [same with standard assets cam look].
@DrSwagGaming2 жыл бұрын
@Hawk Game Dev Hey sorry for asking but I am having a problem... When I am clicking the play button. The left side of my car sinks in the ground while other stays normal (like a flat tire for left side). How can i fix? If u know ofcourse
@ElectronGOD4 жыл бұрын
Once the BrakeTorque is applied, car does not move again when I release the break. Plz help.
@GameDevChef4 жыл бұрын
You can try to remove the isBreaking check on line 45 and make sure that the brakeTorque is set to 0 when spacebar is not pressed.
@boinas4 жыл бұрын
you can try to do this: private void HandleMotor() { if (isBreaking) breakForce = 3000; else breakForce = 0; frontLeftWheelCollider.motorTorque = verticalInput * motorForce; frontRightWheelCollider.motorTorque = verticalInput * motorForce; currentBreakForce = isBreaking ? breakForce : 0f; // you don't need this part because of the if and else you do upper ApplyBreaking(); } ApplyBreaking () { // right there i don't put all wheel colliders! the type of wheel colliders you put here is according to the traction you want to put in the car! // I put for a RWD car (rear-wheel drive)! the video is made for AWD car (all-wheels drive)! // It's to everyone's taste! ;D rearLeftWheelCollider.brakeTorque = currentBreakForce; rearRightWheelCollider.brakeTorque = currentBreakForce; } This method works but if you want a clean and more professional code try to do the wheels colliders with lists! and you can call the wheels with a simple foreach! And carefull because "break" writes "brake"! it's normal this type of errors while programming! especially if you're not english! i can't talk about this because even I do this type of errors! but if you want a correct code try to change "break" and "breaking" to "brake" and "braking"! But sure it was a good tutorial! Congratulations GameDevChef! Keep like that! One more like! 👍 =D
@GameDevChef4 жыл бұрын
I found the problem. Remove the isBreaking check on line 52 in Car Controler script. That should make it work
@shivamchhapola52454 жыл бұрын
@@GameDevChef can you explain why it works without the check
@theplaymakerno13 жыл бұрын
Got please you mate. This script is better than most of the bloated crap we find on the asset store.
@halivudestevez22 жыл бұрын
Seems to be perfect, must try it. (I am lazy, so I will write a code that recognizes wheel colliders, and assign them to an array)
@IGNACY-fp8zo2 жыл бұрын
The wheels just instantly fly off and sink below the ground for me and for some reason the breaks seem to accelerate the flying wheels
@kavipriyank82982 жыл бұрын
Totally the same here! For me, the wheels seem to detach from the car's body in a weird manner and fly away. Its transform keeps changing constantly, while the car's body just falls down on land.
@blissweb3 жыл бұрын
I came here to see how to fix the purple car syndrome and you did that in the first minute. :-) Yay.
@clement2814 Жыл бұрын
Thank you so much. It's fast and efficient as needed.
@walney20083 жыл бұрын
very good, I'm a beginner, I'm from Brazil, I learned to put the car in motion, thank you very much, would there be a video teaching you how to create a race track for you, have a lap counting system and checkpoints?
@MphasieMusic3 жыл бұрын
OMG THANK YOU! You saved my project
@FC12CGaming3 жыл бұрын
Omg thanks so much, i'm literally speechless that it actually works!!!!
@idkidc18853 жыл бұрын
Hey man did u try it out on the new version of unity ?if yes does it work on the new version or only one the one he is using
@FC12CGaming3 жыл бұрын
@@idkidc1885 no im using 2019.4
@FC12CGaming3 жыл бұрын
@@idkidc1885 but it should work on the new unity
@idkidc18853 жыл бұрын
@@FC12CGaming ok ty if it doesnot work on the new ill try that version
@FC12CGaming3 жыл бұрын
@@idkidc1885 k
@SakthivelNadar3 жыл бұрын
This is sooo simple it reminds me physics and maths class not that much i ever attended to maths
@ZyronJeff_09152 жыл бұрын
Thank you for tNice tutorials. You've done a great job breaking down the features and build. I can now concentrate on my instead of the
@operationreddit18043 жыл бұрын
great tutorial, exactly what I was looking for, there is only one problem that i'm facing. its input lag. when I put motorForce to 2000 for example, and when I try to break, there is a lag of about second or 2 before starting to break, and problem is amplified with higher numbers, at 5000 its about 4-5 seconds. does someone have a solution for this?
@hdprodesignteam2312 жыл бұрын
Check this links: Hope helps. kzbin.info/www/bejne/fIfZXpt7l6mEd8U kzbin.info/www/bejne/fZ3EoJyQbZV-mbc Playable Demo : drive.google.com/file/d/1_JnQSfTP8E7EfKZhJVdClohhxBQ7cgei/view?usp=sharing Kindly waiting for your comments to improve it. Thanks.
@lostsoop3 жыл бұрын
How can i change the speed / acceleration of the car?
@matymare3 жыл бұрын
Change motor force amount
@lostsoop3 жыл бұрын
@@matymare it doesnt help ig but thank you anyways
@barebones.3 жыл бұрын
if you want to make it slower then you can increase drag ( 1 - 3 will probably be as high as you can go ), but im not sure how to make it faster.
@lostsoop3 жыл бұрын
@@barebones. i think the car falls over when i increase the drag
@Max-kb6ui3 жыл бұрын
@@lostsoop Same problem
4 жыл бұрын
Thank you for making it simple
@elitebooger82084 жыл бұрын
So my car just flys threw the air and I changed the weight on the wheels and body.
@musicland57864 жыл бұрын
Just add a component (rigid body)
@diliupg3 жыл бұрын
congratulations on the flying car! :-D
@0kr4m2 жыл бұрын
great tutorial! one question: is there a way to give a boost in speed? I can't even change speed values.
@bloggerblogger24102 жыл бұрын
yea i've the same question i need the car to accelerate quicker and go faster and changing the speed/motorForce didn't help at all .
@gamedev_navneet3 жыл бұрын
I like your discipline while coding.
@mythicaldriftz33573 жыл бұрын
Are you some sort of wizard man i have so much respect for you dude i have tried this and it works yes so to anyone wanna try just do it as he says
@RavishingPimp Жыл бұрын
(If anyone needs it. I did make some differences (Like capital letters on some stuff, but that's all) using System.Collections; using System.Collections.Generic; using UnityEngine; public class CarController : MonoBehaviour { // Rename the terms used in the Unity physics engine private const string HORIZONTAL = "Horizontal"; private const string VERTICAL= "Vertical"; private float HorizonalInput; private float VerticalInput; private float currentbreakForce; private float steerAngle; // Choose whether to break or not private bool IsBreaking; [SerializeField] private float motorForce; [SerializeField] private float breakForce; [SerializeField] private float maxSteerAngle; // SerializeField is because we don't want other scripts to access it, but we do in the inspector [SerializeField] private WheelCollider FrontLeftWheelCollider; [SerializeField] private WheelCollider FrontRightWheelCollider; [SerializeField] private WheelCollider RearLeftWheelCollider; [SerializeField] private WheelCollider RearRightWheelCollider; [SerializeField] private Transform RearRightWheelTransform; [SerializeField] private Transform RearLeftWheelTransform; [SerializeField] private Transform FrontRightWheelTransform; [SerializeField] private Transform FrontLeftWheelTransform; // We use "FixedUpdate" because we need to use the Unity physics engine private void FixedUpdate() { GetInput(); HandleMotor(); HandleSteering(); UpdateWheel(); } private void GetInput() { HorizonalInput = Input.GetAxis(HORIZONTAL); VerticalInput = Input.GetAxis(VERTICAL); IsBreaking = Input.GetKey(KeyCode.Space); } private void HandleMotor() { FrontLeftWheelCollider.motorTorque = VerticalInput * motorForce; FrontRightWheelCollider.motorTorque = VerticalInput * motorForce; currentbreakForce = IsBreaking ? breakForce : 0f; if (IsBreaking) { ApplyBreaking(); } } private void ApplyBreaking() { FrontRightWheelCollider.brakeTorque = currentbreakForce; FrontLeftWheelCollider.brakeTorque = currentbreakForce; RearRightWheelCollider.brakeTorque = currentbreakForce; RearLeftWheelCollider.brakeTorque = currentbreakForce; } private void HandleSteering() { steerAngle = maxSteerAngle * HorizonalInput; FrontLeftWheelCollider.steerAngle = steerAngle; FrontRightWheelCollider.steerAngle = steerAngle; } private void UpdateWheel() { UpdateSingleWheel(FrontLeftWheelCollider, FrontLeftWheelTransform); UpdateSingleWheel(FrontRightWheelCollider, FrontRightWheelTransform); UpdateSingleWheel(RearRightWheelCollider, RearRightWheelTransform); UpdateSingleWheel(RearLeftWheelCollider, RearLeftWheelTransform); } private void UpdateSingleWheel(WheelCollider WheelCollider, Transform wheelTransform) { Vector3 pos; Quaternion rot; WheelCollider.GetWorldPose(out pos, out rot); wheelTransform.rotation = rot; wheelTransform.position = pos; } }
@erfanroghani2 жыл бұрын
Excellent tutorial, man! Super useful. But for my application, I need to ensure there is no rotation around the X-axis while applying the brake. How should I set the parameters?
@ghostawader92282 жыл бұрын
Sorry I'm totally new to programming but why doesnt the Input.GetAxis and the Input.GetKey(Keycode.....) change color when I write it down on C# the exact same way he did it at 4:01. I noticed it happens to more rows aswell
@ghostawader92282 жыл бұрын
It even gives me a warning about it at the bottom in a red text
@Nexus-fi1hb4 жыл бұрын
The wheel colliders of my car just detatch and fly into the air and pressing wasd doesen't change anything, pls help
@m0ch1_64 жыл бұрын
Hey Nexus, to fix your problem you should ensure that wheel collider and wheel mesh are not on the same game object or child
@Nexus-fi1hb4 жыл бұрын
@@m0ch1_6 thx, I've already fixed that problem, but now I can't get my car to get faster, no matter what motor force I set. It just keeps driving at the same speed.
@AugGust4 жыл бұрын
@@Nexus-fi1hb U mean for acceleration? If turn the camera to the side u can see in the sample project, the tyres do not have enough grip and the tyres just slip
@lukascampbell58813 жыл бұрын
@@AugGust hey, do you know what i should do if only my front two wheels are rotating? (& turning)
@AugGust3 жыл бұрын
@@lukascampbell5881 The setup for the front and back wheels should be identical? Just go through and make sure you didn't miss anything
@anonymousa70303 жыл бұрын
THANK YOUU!! it is very simple and helpful
@theabbie32492 жыл бұрын
is the updateWheel() for updating the visuals or actually driving the car? can I get away without using it?
@bithigh8301 Жыл бұрын
It works pretty good. Thank you!
@thelife88364 жыл бұрын
The best tutorial. Is single wheel update method essential?
@dwinkley3 жыл бұрын
He stole the code from kzbin.info/www/bejne/oGfChICajMp6fKs
@timhoutman64133 жыл бұрын
5:35 love the way how you say motor torques. Thanks for the video man.
@victorfiy98442 жыл бұрын
dude everything is nice and all but how do i add lerp to the Turing of wheel from left to right because it just snaps which i don't like so any idea on how to
@Twiney_2 жыл бұрын
This is my first time coding and it works great thanks dude!
@infinit_y7000 Жыл бұрын
The script wouldn't work it tell me "the reference script on this Behaviour (Game Object 'Car' ) is missing"
@TheCoolcomplex2 жыл бұрын
why are the rear wheels being updated if the parameters of rear wheel colliders never change? from my understanding, the front wheel colliders move according to the torque that is being applied, and the wheel transforms have to be updated to match the wheel collider positions and rotations, but from the code itself, the rear wheel colliders do not move since the torque is only applied to the front wheels in the code, so how do the rearwheel colliders move?
@miguelpereira46452 жыл бұрын
The physics system automatically move them when the car moves because they are rolling in the ground
@eleanordare93502 жыл бұрын
very clear and solved all my problems, thanks so much :-)
@gamedev_navneet3 жыл бұрын
Thank-you , this is working perfectly!👍
@roostydoo23 жыл бұрын
Will it still work if you don't use lwrp project ?? EDIT: I'm using 3d with extras
@punit11super3 жыл бұрын
Yes it will
@boomboyag46143 жыл бұрын
I don’t think anything in the scripts deals with rendering.
@Theferrariguy4 жыл бұрын
Whenever I play the game, The car's motor and brake force change to different setting sand the car goes really slowly please help
@harshvardhanmisal22554 жыл бұрын
Change it in inspector window click on object which has script and then change the values
@Croccolucho3 жыл бұрын
Got the same problem, idk what to do
@Theferrariguy3 жыл бұрын
@@Croccolucho I ended up using vehicle physics pro asset it's very useful I'd recommend it
@Vetrillum2 жыл бұрын
Thanks, it worked! But the rear wheels are rotated at Y180, please help
@farruholimov82812 жыл бұрын
WheelCollider's GetWorldPose is messing up WheelTransform's position. It's pushing the wheel away for certain distance. What might cause it?
@wingy43873 жыл бұрын
Followed exactly as you did, but sadly my car still seems to spin out so easily when turning, I've played with changing values and have also moved the wheel colliders slightly, which helped a bit but it still can't handle driving around a track at speed, what can I do to make it better?
@hdprodesignteam2313 жыл бұрын
Hey Wingy, Here some links for the HD Car Controller V 3.5. kzbin.info/www/bejne/fIfZXpt7l6mEd8U kzbin.info/www/bejne/fZ3EoJyQbZV-mbc Playable Demo : drive.google.com/file/d/1_JnQSfTP8E7EfKZhJVdClohhxBQ7cgei/view?usp=sharing Kindly waiting for your comments to improve it. Thanks. Best Regards HD Pro Design Team
@simplygamedeveloper78592 жыл бұрын
Change the value of suspension to 1.
@TFG2873 жыл бұрын
Assets\sCRIPTS\CarControol.cs(72,1): error CS1022: Type or namespace definition, or end-of-file expected :I need help
@muhdasyraf99282 жыл бұрын
Hi! I got a problem when using your code... it seems that my car dint stop accelerate after i press forward...any idea to fix it??
@RobertGatesC4 жыл бұрын
Dude, you are a lifesaver. Thank you, brother. I was looking for a vid that would go step by step through the process, and if people want to check the coding under the hood so to speak, you have that too. For someone that doesn't know coding, and wants to put out a game, this is amazing info. And how you did it step by step. Love it. Would you also be able to make a vid of how to easily train any AI car to run a track, and with other AI cars? If so, that would be amazing. Thanks again, and a big thumbs up from me. :)
@FelineRaptor-gv4te3 жыл бұрын
As for ai cars, you can check out Unity's standard assets. there is something called car ai waypoint.
@wa-ir1br4 жыл бұрын
広告から飛んできたけどまじでわかりやすい!
@officialtatex3 жыл бұрын
true
@browneburbs5377 Жыл бұрын
I have some problematic issues. While I am using a different car model, I don't think it should be any different than what this model provides, but regardless: I've followed the tutorial very well, but I've ran into two problems. When I add a Wheel Collider, it doesn't show up at all during the editing, unless I make a rigidbody component. But once everything was set up and handled, the car either bounces and flies in all sorts of directions that's not wanted, the wheels fall through the plane and into the abyss, or all the wheels snap to position 0, 0, 0. It's very infuriating and I'd love to get this fixed!
@sinanarts2 жыл бұрын
Hi, Can I use the same exact flow for a VR Car simulation.?
@drewvananne17963 жыл бұрын
Exactly what I was looking for, great tutorial!
@kimjongun57392 жыл бұрын
Does anyone know why my current break force in the inspector tab stays at 0 (whenever I change it just goes back to 0) when I start playing my game?
@peterbutterfield11534 жыл бұрын
So the moving / driving is working fine i changed the motor a bit to suite my little game but the breaking just is not working iv tried removing the "isbreaking check" on the line 52 like you said to another person in the comments and i tried what another person said to that reply and neither worked well the original worked kinda where it breaks but then stuck with the break i also tried a few solutions i thought of but non of them worked mainly one that checks if break force is 3000 then check if space is being clicked make the motor torque to the breaking force that is required to stop the car from moving. Any help would be great
@marcosbenedico73044 жыл бұрын
Same problem
@NewEraGamersOP2 жыл бұрын
Any solution you got ?
@salmansaleem21912 жыл бұрын
bro, the car isn't moving with the arrow and WSAD keys, the wheels turn but the car doesn't move forward or backwards please help thank you
@davekomen66002 жыл бұрын
I can't edit the speed and everything in the script. so i cant adjust the speed, steeringangle and brakeforce. Can u help me plz?
@megozcreed51964 жыл бұрын
if I want the car to apply brakes as soon as I release any of the W S or Up Down buttons , what should I do
@Randomiz8orinator4 жыл бұрын
try reading the input.GetKeyUp method
@megozcreed51964 жыл бұрын
@@Randomiz8orinator well i knew about them , I was meaning how to stop the car momentum , what code to put in the get key up func. I tried motor torque =0 Brake torque = Mathf.infinity But it still didn't stop as soon as key up So had to play with the rigidbody velocity for it to work.
@thaddeusnoffsinger24103 жыл бұрын
Did you figure this out? Having the same question.
@nbgtube4682 жыл бұрын
I’m having problems where the wheel colliders start to push away from the vehicle making it float, does anyone know how to fix?
@HitesH3D3 жыл бұрын
I made the car with a fully functional car controller. it was working fine but when I use the same script and method on the new car mess it's not working. well are rotating but the car is not moving. any solution.
@elicopter_go_brr3 жыл бұрын
so remember...this tutorial is VERY SIMPLE!
@francek38923 жыл бұрын
Unity doesnt support rigidbody, we need a new tutorial lol
@ImScorpy2 жыл бұрын
Note to people trying to make a Vehicle controller: DO NOT use Time.deltaTime on the motorTorque code
@walney20083 жыл бұрын
I put the wheel configurations as in the video, but even putting a mass of 50000 the car will still be lifting, what can it be?
@leonamferreira80533 жыл бұрын
try changing the suspension spring to 90000 and damper to 9000 on the wheel collider. Remember to change it for every wheel collider on each wheel.
@sebasA2 жыл бұрын
Thanks, how can I do to stop the car slowly while Im not pressing up key with just the friction? Actually the car never stops, just with break.
@iRuR2 жыл бұрын
W is for throttle, S is for brake, Space is for handbrake i think
@luanayres9418 Жыл бұрын
I'm using a model car from the polygon city pack and I get a error: "Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported since Unity 5". I noticed too that the wheels already have a sphere collider, but i don't know how to adapt it to the script. I'm new to unity, please someone help.
@rajdeepdas863 жыл бұрын
Awesome hands-on tutorial. Can you please do a similar tutorial for bicycle?
@trunkmonkey57493 жыл бұрын
I'd just take away a set of wheel colliders and add a bike model. I think it'd be very similar to the car.
@filippodeluca94643 ай бұрын
my wheel detacted from the car and go on their own, how do you fix it please
@julioaviles8125 Жыл бұрын
what did you press on 5:43 to change only the 2 you needed
@bellanurhaliza54713 жыл бұрын
Why every time I play, the object always bounces?? And is each version of unity, the script is also different? Please help me
@HATL2012 жыл бұрын
Thanks a lot for the project dear.
@edmashokmusic1692 Жыл бұрын
For all those looking for car not moving after applying brakes. read the video description
@toaster-chan73863 жыл бұрын
So I was wondering, what would I do to keep the max speed the same but increase acceleration? Would it be like, increasing the motor force and placing a basic "if-then" statement to stop it exceeding a certain speed?
@flatikk2 жыл бұрын
You could have it so that when you press the gas, it takes a certain time for the motor to reach the target torque, either using curves or basic script math/logic. Simply put, keep the maximum output of the engine unchanged but make it be achieved quicker or slower.
@EmperorStick3 жыл бұрын
I just have one problem with the camera… when I flip the car, which is sometimes possible, the camera goes under the ground... Can you help me? Thanks :D
@Sweet-z8m3 жыл бұрын
why are we using SerializeField instead of the normal class. I just want to know
@ramaarya32 жыл бұрын
Thankyou so much, you're lifesaver.
@HilalWaul2 жыл бұрын
can someone explain to me, what visual studio extensions used on this video ? especially for the auto methods, auto type and colorize ? thank you
@virxest Жыл бұрын
Even these tutorials are one big headache. When I finally get to the "Asset Store" and downloaded this package, I press "Open in Unity" and nothing happens. I already need a tutorial for this tutorial. I could only download but how do I "Import"?
@juleswombat53092 жыл бұрын
Cool Nice and Straight Forward.
@ZAYMANGAMESTUDIO2 жыл бұрын
Hi, my issue is that I don’t want to use only pc to brake the car, but also my joystick
@derickchan36383 жыл бұрын
when i try to turn left or right when its reach high speed how to make the car not flipping should i change the mass of the car and the wheels?
@lukasriedl88594 жыл бұрын
I modeled my own car and everything works fine, except for the Wheel Transforms. They rotate in a weird way around the car and not around themselves. Is there any way to fix that? Thanks in advance.
@alexandru-cristianpop70994 жыл бұрын
Take one wheel mesh and make it wheel collider object child. Reset the transform of the wheel and then put it back in the mesh section. Repeat for the other 3 wheels. Worked for me
@lukasriedl88594 жыл бұрын
@@alexandru-cristianpop7099 It seems to work but the only problem is the scale. I have to set the scale to 100 but then the error occurs again.
@lukasriedl88594 жыл бұрын
@@alexandru-cristianpop7099 I fixed the scale thing. There was a problem with the blender export. Now i still have the problem with the rotation and what you suggested did not work.
@alexandru-cristianpop70994 жыл бұрын
@@lukasriedl8859 I'm sorry then, bro
@Leo7854 жыл бұрын
@@lukasriedl8859 put the origin of your wheel mesh in the center of your mesh.
@nunotorres6363 жыл бұрын
hey man , can u tell me why my car is not steering anything. he just urns a little bit but is very slow turning
@Coding_technique1237 ай бұрын
Can I run this game by just using this project file From the GitHub after extract
@jvstAsYouAre3 жыл бұрын
I have seen a couple of comments asking how it could be possible for the wheels to be rotated 90 degrees when you start the game but nobody has been able to answer the question. PLEASE HELP!
@maximizer1743 жыл бұрын
yeah, me 2...pls help
@a7medabdalhadi7803 жыл бұрын
I think u made ur own car then imported it into unity I faced this problem also and it is easy to fix, u have to change some details in the script -First go updatesinglewheel method and enter new Quaternion called it "Rightrotation" or any name u want to -next write down this line: Rightrotation=new Quaternion (rot.X, rot.y-1,rot.z,rot.w); //this line should be written after Wheelcollider.getworldpose... etc// -Then change wheeltransform.rotation into: wheeltransform.rotation= Rightrotation; I wish this could help u :)
@chrisliyasstorytime32334 жыл бұрын
Sorry but can you tell me what is the reason my car still flips even if I change the spring and damper value ?? Please help
@nsb_tv58203 жыл бұрын
the only word is perfect for this video
@daniellundholm70794 жыл бұрын
When we start creating code in C#, you delete the first lines and replace them with "FixedUpdate". That doesnt appear for me. There are no such thing as "FixedUpdate" in visual studio. It bothers me because it is a really nice tutorial otherwise and I want to finsih this so bad. Please help!
@あれくす3 жыл бұрын
Fixed update is a built in UNITY FUNCTION part of ALL MONOBEHAVIOUR classes. Visual studio is CLUELESS to FIXEDUPDATE unless you run the unityaddon for visualstudio which you should have if you are using unity.
@RAVuu_4 жыл бұрын
It shows that currentsteerangle is not a variable, and adding one messes it all up. Do you know what I did wrong? Did I miss anything?
@nieruseqq46333 жыл бұрын
I have this same error do you fix that?
@josemariatoledomoreno18033 жыл бұрын
Hi, i have a problem, when my car touch the ground it go up again quickly and it doesnt stop to go higher. Could you give me a solution?
@dradex95623 жыл бұрын
if you watch it after he finishes the script you have to change the mass of the rigid body from 1 to 1500