Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Aug 12, 2016 at 09:07 AM by Okey92 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Okey92 · Aug 11, 2016 at 03:44 PM · physicscollidercarvehicle

Unity 5 - good parameters for vehicle

I have a problem with colliders. First - stats: Car:
mass= 1000
motor torque= 5000
steer angle = 25

wheel colliders:
mass= 25
radius= 0.5
wheel damping rate=0.25
suspension distance = 0.5
force app point distance=0.1

Suspension spring
Spring = 35000
Damper = 3500
Target position = 0.1

Forward friction
Extremum slip:0.5
Extremum value:1
Asymptote slip: 0.8
Asymptote value:0.5
Stiffness:1

Sideways friction
Extremum slip:0.2
Extremum value:1
Asymptote slip: 0.75
Asymptote value:1
Stiffness:1

The problem is sliping. My car wheels rotating to infinite, but acceleration is about ~2m/s I want to have a car with ~100% friction, almost no sliping, for high speed and acceleration. I tried to handle with every param, but I cannot do it work correctly. I know there is a car in standard assets, but this code isn't looking good for me and I want to do in other, standard way. Is there a possibilty, without a hacks in code, to work those wheels like real one? If somebody have good model, with parameters, I would be pleased for used statistics. What I did wrong (parameters, ground?)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
3
Best Answer

Answer by DiegoSLTS · Aug 11, 2016 at 05:25 PM

Setting up a usable car is really tricky, The setup also depends on the position and size of wheels and the car body, and if you're just reading the Unity manual you'll miss a really important thing: Stabilizer bars

In a game I made in Unity 5.1.2 I have...

Car

Mass: 1500

Drag: 0

Angular drag: 0.05

Max motor torque: 400

Max steering angle: 10

Wheels

Mass: 20

Radius: 0.23

Wheel damping rate: 0.25

Suspension distance: 0.1

Force app... : 0

Center: 0,0,0

Suspension spring Spring: 100000 Damper: 2000 Target position: 0.5

Forward and Sideway friction 1 in everything except Stiffness, with 5

Also, for the stabilizer bars: Anti roll: 10000

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Okey92 · Aug 11, 2016 at 07:01 PM 0
Share

It's very slow, and car is shaking. I set 400 torque for 2 back wheels. Acc it's about ~2/s and big sliping. $$anonymous$$aybe it's about ground material (no material). Simple solution it's to increase timestep and reduce gravity. Do your car is fast enough?

avatar image DiegoSLTS Okey92 · Aug 11, 2016 at 07:18 PM 2
Share

In my game the car is on a mountain so it gains some speed because of gravity. Is fast for what we wanted to do, which was a billy cart, it's not supposed to gain speed like a real fast car, but we do force some acceleration in case the car gets stuck at something. At some point it was too fast so we also apply a break force after reaching a certain speed.

I think (it's an old project) the shaking was related to the "substep" used by the physics engine. The magic numbers for us were:

 anyWheelCollider.ConfigureVehicleSubsteps(5f,12,15);

It says "anyWheelCollider" because you only need to set the substep once, but it's not a static method so you need an instance of WheelCollider to change it's value.

Anyway, it's a pain to set this things up, most of the times it felt like I was trying random values for everything. If you research a lot you'll find a video of someone that "fixed" his car physics after upgrading to Unity 5 by setting the car weight to an unrealistic low weight (like going from tons to less than 100 kilograms). It takes time but at some point you'll find some magic numbers for your game.

This was the game: https://www.youtube.com/watch?v=Hjii7E_zQyA It's not on the store anymore but you can see the game running at 0:30.

avatar image Okey92 DiegoSLTS · Aug 11, 2016 at 09:16 PM 0
Share

I do like in https://www.youtube.com/watch?v=HT15SlYr2Pw. You are right, it was a mass problem. $$anonymous$$y stats for now (if somebody would like to know):

$$anonymous$$ass: 20

Drag: 0.1

Angular drag: 0.05

$$anonymous$$ax motor torque: 100

$$anonymous$$ax steering angle: 10

Wheels

$$anonymous$$ass: 10

Radius: 0.4

Wheel damping rate: 0.25

Suspension distance: 0.1

Force app... : 0

Center: 0,0,0

Suspension spring Spring: 1200 Damper: 50 Target position: 0.6

Forward and Sideway friction 1 in everything except Stiffness, with 5

I have sliping ~0.05 and problems with car rolling on turns, but it's good start to improve steering. Thanks for help!

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

fast forward physic vehicles 0 Answers

Vehicle programming source 5 Answers

Need for speed like physics using Edy's vehicle physics? 1 Answer

Strange car beahaviour 0 Answers

How can i import a new car in edy's vehicle physics? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges