Search Unity

Vehicle Help

Discussion in 'Scripting' started by LittleJ, Apr 16, 2014.

  1. LittleJ

    LittleJ

    Joined:
    May 26, 2013
    Posts:
    5
    Hello,

    So I am currently using a vehicle Physics system that i purchased however im struggling.

    Not particularly with the System as thats not what i need help with.

    I am trying to match the vehicle physics of Gta SA, i need thos type of physics to make the game i am making work out.

    I have been trying for days to get it like the GTA sa vehicles but I just don't know how to do it?

    Could any of you help out a little?

    For example, The Balance of vehicles, how they flip so easily and how you can control them in the air.

    Any help at all would help me out and i would appreciate it!

    Thankyou.
     
  2. bigmisterb

    bigmisterb

    Joined:
    Nov 6, 2010
    Posts:
    4,221
    Start with naming the system that you purchased. its a little vague just saying a Physics system.

    Next, balance of a vehicle has to do with several factors. The vehicle's center of mass, the spring strength on each wheel and all the wheel underside stuff. (by that I mean forward and sideways slip and stiffness and such).

    Your springs should first be long enough to let the wheel travel, but not so long that the wheels look funky when the vehicle is in the air.

    The main body collider needs to be far enough off of the ground so that the physics engine doesn't hit and cause funky things to happen. I actually move it up a little into the body so that it doesn't hit.

    The center of mass should be in the center of the vehicle, plus where the largest mass is in the vehicle. If it is a front engine car, it should be a little forward. Say 0.5 to 1. overall the center of mass should be about the middle of the vehicle. NEVER set the X on the center of mass to anything but zero, you will get funky results.

    Spring strength should be about twice that of the vehicle on each wheel. I test this by simply starting my game with my vehicle 10 feet in the air. When it falls, i want it to bounce up some, not off the ground, but look realistic when the vehicle its a heavy bump.

    Once I have my spring strength done correctly, I test my forward and side slip curves. The engine numbers for each are about 0.02. I usually just set the forward off to 0.02 and leave it because if you tinker with it afterwards, you will have to reset gears and all this other crap that I don't really want to redo all the time.

    Sideways is funky, if it's too high, your car will flip easy, if it is too low, you can't turn.

    Lastly, there is something called Anti-Roll. This is a bar that is in the front and back of the vehicle that pushes up on the corner of the vehicle that has the higher compression. This is a factor between the left and right wheels on either side. Properly setting up Anti-Roll helps your side slip curve out a lot.

    For sure, making a proper car takes lots of time and playing and tinkering. The settings I pointed out are generic, they are a starting point.
     
  3. LittleJ

    LittleJ

    Joined:
    May 26, 2013
    Posts:
    5
    Thanks very much, and the car physics system is Vehicle Physics Toolkit v1.3