- Home /
Car rear Wheels bug/error/issues!!!
I have been playing with exactly the same issue for hours and hours and its really starting to bother me. i have never had so many issues with exporting etc. there doesnt seem to be any set way of getting the rear wheels to work properly!
My models are made in max, the pivots are set at the centre of each model, i have even done a trick of attaching to a box at that pivot then removing the box element etc so i know the models are clean. I have tried exporting from fbx 2011 with both the y-up and the z-up settings and neither seem to make a difference.
I have tried over and again with the grouping. I have set the groups in max wheelFR/WheelFR.2 etc just as the tutorial states to try to get the process the same. I have also tried the empty game object and this also just ends up with my rear wheels positioned at 0,0,0 in the centre of my car spinning away. front wheels are right EVERY time! There must be some kind of set order like creating an empty object, setting to the wheel position then attaching the wheel. But i cannot find a way no matter how much i try!
im starting to think it could be an error in the car script or it could be the fbx exporter?
So the issues im getting are:
1: Wheels slightly below the ground and no movement at all (usually is the groups were set in max and i applied them straight away) 2: Same as the previous issue but the wheels will turn (usually after i have set the 270 rotation to 0) 3: Front wheels turn and drive the car, rear wheels are set at 0,0,0 in the middle of my car and spin with the movement of the car. 4: the rear wheels are just up in the air and not in any way related to the car as per the models in the model view! 5: For all of the problems above where the car will drive, if i flip it or crash enough so that the body is lifted, the wheels jump back to where they should be!!!!!! Surely this is a code issue to do with the wheels being in contact with the road??
If someone can give me any idea on what i can try i would be so grateful. I can even send the files over im that desperate to understand this!lol
Answer by Edy · Nov 30, 2010 at 01:32 AM
If you are using the Car Tutorial, then is a very bad idea IMHO. The car controller script (Car.js) is obfuscated and specifically designed to work in this exact project, not as generic vehicle control script one can reuse or learn from. It doesn't use the WheelColliders from the model, but it creates its own GameObjects and WheelColliders at runtime! So its very difficult to keep track on what and how the script does anything, or if it's actually using your references or any others it has created internally.
My recommendation is to follow this tutorial instead. I believe you'll see much better results. http://carpe.com.au/slawia/2009/08/unity-wheel-collider-introduction/
If you need something already working to start from, you may check out my vehicle physics here: http://forum.unity3d.com/threads/47366-New-Unity-Car-Tutorial-GTA4-Vehicle-Replica-Project-4050?p=414127&viewfull=1#post414127
Answer by ebutler3D · Feb 15, 2013 at 11:53 AM
This tutorial i thought was going to be simple, but had all of these same problems.. unfortunately sometimes there isn't a set solution, but i found it helped to import the catamount fbx into max and get it next to your model.. Hierarchy on the wheels goes WHEEL_FL (Dummy), WHEELFL.2 (Wheel mesh) and DiscBrakeFL (mesh also). Make sure your wheels pivots are centred and xformed (Utilities > xform > reset selected). Make sure you are dragging the disc brake obj into the car.js script attached to the object (i swapped the front discbrakes around on the script input and that worked for me).
In regards to the rear wheels 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...
Your answer
![](https://koobas.hobune.stream/wayback/20220613075829im_/https://answers.unity.com/themes/thub/images/avi.jpg)