Search Unity

Wheel Collider Fiasco

Discussion in 'Editor & General Support' started by Mindless_Soul, Sep 1, 2006.

  1. Mindless_Soul

    Mindless_Soul

    Joined:
    Feb 1, 2006
    Posts:
    128
    I am getting really frustrated here. I don't even fully know how to explain my problem.

    I made a quick truck model in Blender and am trying to get a very realistic control set working for it. I was doing it from scratch and wasn't liking the results, so I looked at how the RaceDemo was made. It's perfect!

    I applied all of the scripts, made the wheel models seperate from the wheel colliders etc. etc.

    This is the one and only result I get (see the video attatched).
    (I can post screens of the data too if that would be helpful)

    I have tweaked, changed, altered, varied, fixed, broken, and swapped every possible aspect of this thing and cannot figure out what is wrong.
    I have spent hours and hours trying to figue out what is going on.

    Has anyone else had a similar problem (or any problems with the wheel collider for that matter)?

    Help!!
     

    Attached Files:

  2. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    Ha, looks like that truck has some serious hydraulic bounce... the lowrider community would be proud :wink:

    It seems like the center of gravity is way off... that, or the wheels are colliding with the ground on start. Try moving the pivot center of the truck in your 3D app, and in Unity move the truck off the ground a few feet and see if it drops to the ground at runtime and then works correctly.
     
  3. hsparra

    hsparra

    Joined:
    Jul 12, 2005
    Posts:
    750
    Looks to me like at least one of your colliders is to large in the Y direction. If you vehicle has a box collider you can see if reducing the size of the Y component helps. If not, check out he scale in the Y direction of the wheel colliders on the back wheels and see if that makes a difference.
     
  4. Mindless_Soul

    Mindless_Soul

    Joined:
    Feb 1, 2006
    Posts:
    128
    I can already feel my headache dissipating...
    The centre points were part of the problem, and that's why when I tried everything over and over again nothing helped...
    It still tips over, but I moved the wheel colliders infront of the vehicle to balance it out :? The script has a center of gravity Y value, but I think it needs a Z value as well...

    Anyway, problem solved.

    Thanks!
     
  5. pete

    pete

    Joined:
    Jul 21, 2005
    Posts:
    1,647
    yep center points are important. otherwise it's an elliptical rotation. i had the wheel collider rotating at one point til joe straightened me out. make sure not to do that. in the assets for that motorcylce test i posted i changed the z center in the car script. don't remember if i kept it in there though.
     
  6. Mindless_Soul

    Mindless_Soul

    Joined:
    Feb 1, 2006
    Posts:
    128
    I did finally get everything aligned correctly.
    Thanks for the info.

    But my truck seems to be tipping over sideways; a lot. I have fiddled with 'Y Down Pressure' , 'Y Center of Gravity' , and even Mass. Nothing seems to be helping.

    Any ideas?
     
  7. pete

    pete

    Joined:
    Jul 21, 2005
    Posts:
    1,647
    i attached empties with raycast colliders at the four corners for stability. do you have those?
     
  8. Mindless_Soul

    Mindless_Soul

    Joined:
    Feb 1, 2006
    Posts:
    128
    I had moved the wheel colliders out a bit and that wasn't working so great, but adding raycast colliders does the trick. Thanks.