- Home /
Bug with rear wheels in Car Tutorial
Hello. I work with Unity for two weeks and I do not understand all the scripts. So 4 days ago I decided to watch some tutorials and found it: "http://unity3d.com/support/resources/tutorials/car-tutorial". It is a awsome tutorial. I made a car game and it was cool, so I decided to make a project with my own car. All things with 3d model are OK. Each wheel consist of the main part, which is linked to DiskBrake, DiskBrakes are linked to dummies. There are no warnings, but there is no result. Car does not want to ride, it just sits on the collider mesh, wheels do not want to turn forward - they only can turn sideways. Then I made my 3d model with my cars body and tutorial car
s wheels. Situation is better - car can ride, slip and other things, front wheels are OK, but...but rear wheels fly above the car! They behave well - it means that they do not fly uncontrollable. They move according to road and it looks like that rear colliders are on their places, they do not let the car fall on its back, but the graphics are above the car. I can add more that this bug is when rear wheels are grounded. For example, if car is flipped all wheels are on their places. Also these rear wheels move according to car
s gears. On the beginning of the gear they are top and at the end they are below. I hope you could help me.
There are some screenshots: http://i035.radikal.ru/1006/86/68c0c6748c30.jpg http://s15.radikal.ru/i188/1006/67/e6354c39d213.jpg
Answer by spinaljack · Jun 17, 2010 at 02:29 PM
You've not centred the wheel models, to fix this simply create an empty game object and place the wheel model in the container object.
Make sure that the container is facing forward (x-axis pointing right, y-axis pointing up) and make sure that the wheel model is in the middle of the container.
When you rotate the wheel model, rotate the container instead and it will be perfectly centred.
I have same problem. But my english is bad and i do not quite understand what you suggest to do. In 3dmax my wheel model contains: Wheel_1 (Dummy) -> Brake (Dummy) -> Wheel_2 (Cylinder). All pivots (of one wheel) are in the center of the object and have the same coordinates. Why do I need to center in Unity, again? And how? I tried to do as you said, but did not work. Perhaps I misunderstood.
That's what I have http://www.youtube.com/watch?v=W_4yepQqbSo
its test model. i tried to eli$$anonymous$$ate all factors of influence.
Answer by ebutler3D · Feb 15, 2013 at 11:53 AM
The problem initially looks like you're not centering your pivots in the 3d software you are using, but it is not.. or at least wasn't for me, i must have centred pivots and xformed in max 30 times before solving it.
I solved this problem with my own model by duplicating the front wheels, renaming them and shifting the back to the position of the back wheels in unity.. This and redoing the tutorial 15 times, and in an urika moment it worked! Sorry I couldn't isolate the exact problem, but keep trying it and changing things would be my advice for those still struggling..