Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to make a car go faster?

Discussion in 'Physics' started by aa-novik, Apr 18, 2015.

  1. aa-novik

    aa-novik

    Joined:
    Apr 18, 2015
    Posts:
    11
    Hello friends!

    I try to make a very simple car physics. All is I need is to make a car steer and go forward and back. I use this user guide (p. 5 - 7). I created 4 Wheel Colliders for my car model, copied the script and assigned the same values for the variables. In fact, it works, but the car goes soooo sloooooow... I tried to change "Max Motor Torque", using very big values, and the car becomes a little bit faster, but not enough.

    What's wrong with my solution? Attach screenshots of Car and Wheel Collider parameters.

    Untitled-1.jpg Untitled-2.jpg
     
  2. pauloaguiar

    pauloaguiar

    Joined:
    May 13, 2009
    Posts:
    700
    You have in the wheelCollider Mass very high, recommend modify value to 10 at least.
     
    aa-novik likes this.
  3. KingMatthew

    KingMatthew

    Joined:
    Jul 7, 2013
    Posts:
    166
    I agree with Pauloaguiar, your mass on the tires are a little high.
    I always had to have torque numbers in the thousands for my cars. Maybe its the same in this case?
     
  4. aa-novik

    aa-novik

    Joined:
    Apr 18, 2015
    Posts:
    11
    Oh, sorry for the incorrect value on my screenshot, first time it was only 20. I tried to use 10 or 5, but in my case it didn't help :(

    Yes, I understand you, but... 400 - very slow. 2000 - faster, but still slow. 10000 - oh, God, are here any changes? :D So, in my case numbers about 1500 and higher give no visible effect.

    Of course, I always have an opportunity to use standart asset for Car in Unity 5, but it has a lot of unnecessary functions and a little bit difficult for my understanding, so I'd like to write my own script for a simple arcade game.

    Any thoughts? :) Or maybe you know some tutorials, which you have successfully used?
     
  5. KingMatthew

    KingMatthew

    Joined:
    Jul 7, 2013
    Posts:
    166
    Are your springs fully compressed? that might have something to do with it. Try increasing the strength or length of them.

    None of my cars work with the new unity5 wheel colliders. I tried making myself a new car but the wheel colliders are just so buggy I can't do anything.
     
    aa-novik likes this.
  6. aa-novik

    aa-novik

    Joined:
    Apr 18, 2015
    Posts:
    11
    I tried to change some settings of the Wheel Colliders, but behavour of my car became even worse. So I think that values in Unity's User Guide are optimal.

    I'm afraid you're right, they work really strange. With torque is thousands and 1000 kg mass of the car it looks not so bad, but watching old tutorials for Unity 4 I understand, that making cars have become more difficult in Unity 5.

    Thanks for help, friends.
     
  7. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    I have been working with the new wheel colliders. For me, setting the forward friction higher than 1.0 really helped getting the car moving forward. Now if I can only figure out what's going on with brakeTorque working intermittently.
     
  8. aa-novik

    aa-novik

    Joined:
    Apr 18, 2015
    Posts:
    11
    JamesArndt, you mean "Stiffness" parameter? I've been playing with friction for hour and these parameters really helped my car to go faster and steer better, thank you.
     
  9. pauloaguiar

    pauloaguiar

    Joined:
    May 13, 2009
    Posts:
    700
    And breaking too;).
     
    JamesArndt likes this.
  10. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Yeah that's the setting. Cool you got it working.
     
    DrKlopper likes this.