Search Unity

Why does my vehicle behave this way?

Discussion in 'Scripting' started by Tyler Ridings, Mar 6, 2011.

  1. Tyler Ridings

    Tyler Ridings

    Joined:
    Aug 28, 2009
    Posts:
    201
    Im doing some script testing and have pulled my hair out trying to figure out why in the world my vehicle is behaving this way.The vehicle is controlled with unitys wheel colliders.I have edited the wheel collider properties every way known the man and even used some recommended settings found on the forum but cant get my vehicle to stop doing this one problem.

    The problem:

    When i try to turn my vehicle is acts like it is just simply rotation on the front wheels and the rear wheels have no friction.I can come to almost a complete stop with zero throttle but the vehicle is still rolling and when i turn the vehicle will just start spinning kinda slow but very un realistically.The car script is attached as a download if needed.Here is a video witch i hope will help you understand my issues.

    http://www.youtube.com/watch?v=k0KYc_HV8BE

    I want to note that the unity forum really needs to add another section for physics.This really doesnt belong in scripting but it sure isnt a unity problem so i have no idea where else to post it.It does involve a script so i guess it will have to go here.
     

    Attached Files:

    • $Car1.js
      File size:
      10.9 KB
      Views:
      780
    Last edited: Mar 6, 2011
  2. Tyler Ridings

    Tyler Ridings

    Joined:
    Aug 28, 2009
    Posts:
    201
    Bump* Im dieing to figure this out.

    I have tried everything from center of mass,to changing box colliders to hopefully give it the effect i need.
     
  3. andererandre

    andererandre

    Joined:
    Dec 17, 2010
    Posts:
    683
    Did you configure all wheel colliders the same way? It looks to me as if the front wheels would have a way different settings than the rear wheels (they slide sideways in a way that should be possible to eliminate with the sideways friction setting). Which wheels to you use to accelerate? Maybe try using only the rear wheels as main accelerators.
     
  4. Tyler Ridings

    Tyler Ridings

    Joined:
    Aug 28, 2009
    Posts:
    201
    The rear wheels are the accelerators.If you download the script you can see the front wheels do not have power to them.....all the wheels are configured the same the script creates a wheel collider for each wheel and gives it the same settings for each one.I tried bumping up the sideways friction but all it did was made my truck flip very easily but still did the same thing sliding wise.