Having problem constructing a car

So my problem is like this : i am trying to make a very basic racing game, i took a cube game object,attached 4 spheres to it where the cube is the parent. and to the wheels i gave a wheel collider,a rigid body and a hinge joint,all with default values.
the problem is,that at this point if i run the game,as soon as the car touches the ground,it starts bounding like crazy every time it hits a wheel. i didn’t even attach a physics material to the wheels.
i don’t really think it is something that has to do with the physics system or the time steps. maybe i just did something wrong there?

what would be the right way to create wheels and attach them to a car? thank you (:

I haven’t time right now to go into the details of getting a car up and running, but just know that it takes quite a bit of doing to get even a basic, stable car. Instead, I’ll just point you towards an awesome collaboration that’s going on right now (ends this Friday) featuring two ready-to-go realistic car simulations, source code and everything. Trust me, you’ll save a lot of headache and also get an awesome learning tool.

Here’s the thread: http://forum.unity3d.com/threads/47366-New-Unity-Car-Tutorial-GTA4-Vehicle-Replica-Project-4050

If you want to learn to build one instead of buying one, did you go through the Unity car tutorial?

There are actually several approaches to building cars–e.g., ragdoll, raycast and wheel collider. The Unite 2008 physics video shows how to build a raycast “hover” car.

Buy a car system (you have until friday) and rip it apart to learn from it? :slight_smile:

unfortunately i can’t afford to buy anything right now. i simply want to study it.
i did try going through the source code of the car tutorial. but the amount of code there is quite big and i started getting lost along with analyzing it.

so really, all i am having trouble with is the wheels. am i supposed to connect them to the car using a hinge joint? if i remove the hinge joint,then they start moving around instead of staying in the same spot related to the car. if i try to remove their rigidBody,then they don’t spin.

ehh… sorry for the bump. but the thread has reached second page and i still didn’t manage to the solve the problem. is the combination of rigidbody,hinge joint and wheel collider right at all?

Welcome to the forum, Doctor Shinobi!

There isn’t any need to use hinge joints in combination with wheel colliders. Would I be right in thinking you are trying to rotate the wheel collider objects? The name of this component is slightly misleading because it isn’t really a collider as such. A wheel collider works by sending a raycast downward to measure the distance to the road and apply forces at the contact point. This means that the collider object needs to be kept upright all the time. You apply forces to the wheel by changing the motorTorque and brakeTorque properties. The JCar script on the Unify wiki is a good example to work from to understand wheel colliders.