Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[DEPRECATED] UnityCar 2.2 Pro. The most complete and accurate vehicle sim on Unity3D

Discussion in 'Assets and Asset Store' started by newlife, May 23, 2011.

Thread Status:
Not open for further replies.
  1. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    The first issue I see here is that you forgot to set the mesh collider to convex. This is mandatory.
    Let me know if this fix the issue. Make also sure that the mesh collider and the center of mass position is correct.
     
  2. imDanOush

    imDanOush

    Joined:
    Oct 12, 2013
    Posts:
    368
    Well I enabled the option, but nothing changed. :( this drives me nuts. I've found out that the car starts to jump around and vibrate when I set current fuel to zero. I believe the car has no weigh but the fuel tank has.
    What is your idea?
     
  3. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    this is very strange.. can you please make a quick video showing the issue?
     
  4. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Did you add a rigidbody to your vehicle?
     
  5. imDanOush

    imDanOush

    Joined:
    Oct 12, 2013
    Posts:
    368
    Yes. I did exactly what is shown here:

    Interestingly, the problem was appeared ( at 3:34 ) in the video but with a box collider the problem was deleted.

    I can use box collider (as you saw in the last video) but then I can't let a monster truck damage the car or something like that.

    PS: In the video, it is said that "I forgot to add a box- or mesh-collider" but even I use the mesh collider, the car jumps.yet when I use a box collider, everything would be fine.
     
    Last edited: Jul 19, 2015
  6. imDanOush

    imDanOush

    Joined:
    Oct 12, 2013
    Posts:
    368
    I've found out that mesh collider was more than 256 and Unity ignored it. Weirdly, it didn't said "it is more than 255" and I thought it is okay.

    So the mesh collider was more than 255 and was non convex, sorry to take your time. I had this problem for about a month and I have no idea why on the earth took this long to figure this small thing out.

    Sorry sir. And your UnityCar is superb.
     
  7. 1982

    1982

    Joined:
    Sep 30, 2012
    Posts:
    7
    In regards of the car collider and car jumping up and down. I have no idea if this is any correct, but I have found that unless the wheels have colliders on TOP of them the wheels and whole car starts to bounce.
     
  8. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    281
    hi
    thx you can you say me in what script the code for the trailer is ??
    For joint to the truck is ??
    Because i search in the code about trailer but dont find really the code that connect the truck with the trailer ??
    Thx you
     
  9. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    423
    Hello, I am trying to make a button that will Start/Stop engine, and I want engine to stop when it's out of fuel
    Right now engine doesn't stop when fuel tank is empty, it just idles.
    I can find startengine button input in axiscarcontoller, and a startengine bool in drivetrain, but I couldn't understand how they interact. I couldn't find any information in documentation either.
    How can I do this?
     
  10. Sondre-S

    Sondre-S

    Joined:
    Jun 29, 2013
    Posts:
    54
    I see. It seems to be working normally, so I guess it's ok.
     
  11. imDanOush

    imDanOush

    Joined:
    Oct 12, 2013
    Posts:
    368
    I did something else to detach a wheel:
    1. In the axles.cs I added an Update() function which does the story below:
      It first checks whenever a wheel is null or not, then if it is null, it replaces it with an other wheel. but the new wheel is smaller (has smaller wheel radius) and also there is no game object attached to it so it looks like a hidden game object.
    2. added a fixed joint to the wheel that should be detached, and added a number in the "Break Force" textbox.
    3. created a script that checks if the joint is broken the object (wheel) will be destroyed, so I assumed the game object should be "null" ("missing") in the axles component. Then logically the update() function should replace the missing object with the new smaller and not visible wheel.
    As I said, I assumed whenever the wheel get destroyed, another smaller wheel will be replaced, but unexpectedly, when I run the scene all wheels stuck and car wont move.
     
  12. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Did you add a collider to your wheel? it seeems not from the screen capture.
     
  13. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    The engine already stops when its out of fuel. Probably it idles cause you forgot to check "canStall" checkbox.
    In order to implement a stop button, you just need to add a button that, when pressed, calls a function that set a variable, say "switchedOff" to 0 (default value 1). This value should be multiplied to torque value, like this:

    torque = CalcEngineTorque(powerMultiplier,rpm)*switchedOff;
     
    imDanOush likes this.
  14. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Well this is a quite complex matter, so I cant help you on this, sorry.
     
  15. Fred_Vicentin

    Fred_Vicentin

    Joined:
    Feb 27, 2013
    Posts:
    19
    I have a weird bug with my UnityCar, on some machines my car dont acel anymore, and was working, and in some machines it works right ! Whats going on someone had this error ?
     
  16. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Hello,
    as many customers already know, there is an issue with terrain physic materials not recognized any more since about Unity 4.2 (it doesn't affect Unity 5.x). That is, raycasts no longer read the physics material. This issue can be easily fixed by adding this line of code in wheel.cs class:

    Code (CSharp):
    1. if (physicMaterial==null && Terrain.activeTerrain!=null) physicMaterial = Terrain.activeTerrain.terrainData.physicMaterial;
    after the line:

    Code (CSharp):
    1. physicMaterial = hitDown.collider.sharedMaterial;
    As said, this affects only Unity 4.x (starting from 4.2), so Unity 5.x users can ignore this post.

    Hope that this helps.
     
  17. Sulerfy

    Sulerfy

    Joined:
    Aug 4, 2015
    Posts:
    1
    Is it possible to stop immediately a car? This line does not stop immediately the car, but do progressively:

    torque = CalcEngineTorque(powerMultiplier,rpm)*switchedOff;

    How is it possible to do it?
     
  18. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    If you mean to stop any movement, you just need to set
    Code (CSharp):
    1. rigidbody.isKinematic=true
     
    Sondre-S and Sulerfy like this.
  19. Sondre-S

    Sondre-S

    Joined:
    Jun 29, 2013
    Posts:
    54
    ...edit: never mind, found a solution.
     
    Last edited: Aug 17, 2015
  20. Maeslezo

    Maeslezo

    Joined:
    Jun 16, 2015
    Posts:
    325
    Hello,

    How can I increase/decrease the vehicle oscillation when it turns left/right?

    Thank you
     
  21. Sondre-S

    Sondre-S

    Joined:
    Jun 29, 2013
    Posts:
    54
    I just thought of something, is this something that would be useful in a menu scene, where you dont want the car to move? I mean, intead of disabling all the wheel scripts and setting time scale to 0? would you still be able to tweak the suspension travel or camber angle?
     
  22. Artoodiitoo

    Artoodiitoo

    Joined:
    Jan 27, 2014
    Posts:
    65
    I can't get force feedback to work in my project, I always get an error message when starting the player;
    "DllNotFoundException: Assets/Unitycar/Plugins/UnityForceFeedback.dll"

    Does anyone know how to fix this?
     
    JuhaFH likes this.
  23. JuhaFH

    JuhaFH

    Joined:
    Oct 24, 2013
    Posts:
    9
    Waiting FFB for Unity5 too, any plans for that?
     
  24. Davidbillmanoy

    Davidbillmanoy

    Joined:
    Jul 7, 2014
    Posts:
    120
    Does it have Pacejka tyres?
     
  25. ralph.yasc

    ralph.yasc

    Joined:
    Oct 26, 2015
    Posts:
    3
    Hi Sir, i tried to test my Xbox steering wheel controller to play UnityCar 2.2 Pro but the pedals controller is not recognized such as accelerating and break. Were planning to purchase this game as Car Simulator for our product for the upcoming electronic expo.

    My question is do i need another software to install so that UnityCar 2.2 Pro will recognize the Pedals controller as Car acceleration ? What should i do ?. Thanks Peeps :)

    Here is the link for the game : http://unitypackages.net/unitycar/joomla/index.php
     
  26. ralph.yasc

    ralph.yasc

    Joined:
    Oct 26, 2015
    Posts:
    3
    Hi UnityCar,

    I tried to use Xbox steering wheel and pedals to test UnityCar 2.2 Pro in the browser, The pedals is not recognized such as accelerating and break. Were planning to purchase this game as Car Simulator for our electronic product for the upcoming expo.

    My question is do i need another software to install so that UnityCar 2.2 Pro will recognize the Pedals such as Car accelerating and Break ? What should i do ?. Thanks
     
  27. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541
    I am interested to purchase your nice looking asset, could I ask if there any video tutorials on how this works and it's features? I want to check how it works and the features before I spend all the money :)
    Has your asset got 3d tire or tire deformation implemented yet?
    I’m making an offroad car game that being published on steam, I am wondering if your asset will work for my needs.
     
  28. neinei89

    neinei89

    Joined:
    Oct 10, 2012
    Posts:
    2
    The controls do not respond well at high speeds, it is almost impossible twist . Any suggestions?
     
    Meceka likes this.
  29. Doctor-Nitros

    Doctor-Nitros

    Joined:
    Oct 2, 2013
    Posts:
    2
    Hello

    I was wondering,maybe It's possible to re-make sound controller so that It won't just pitch two looped audio clips but play two audioclips differently?
    I mean like playing accelerationn sound clip and deceleration sound clip like many games do...
    It's hard for me to tell what I want, but If you will listen to theese 2 samples you will understand meimmediately

    http://www.mediafire.com/download/qz5hafaps74y9ke/example_sounds.rar
     
  30. Sondre-S

    Sondre-S

    Joined:
    Jun 29, 2013
    Posts:
    54
    Newlife, What is the best way to make a car stay in the exact same position (in a menu scene) while still being able to tweak the suspension? When the physics is enabled the car can slide a little bit per frame even with the handbrake or the brakes on...

    Until now I just disabled the rigidbody and the wheel scripts, but It's not a good solution because 'the suspension will be fully compressed and because of this you can't see the how much travel you have.(in my game you can adjust the ride height in the menu).

    I'm wondering how you do this in Real Drift. Hope you can answer this as a general advice to all unity car users as this must be a common situation for most people, I mean all games have a menu.

    The problem with leaving the physics on is that the cars "jump" each time they're loaded.
     
    Last edited: Dec 25, 2015
    Meceka likes this.
  31. Fortunato1

    Fortunato1

    Joined:
    Jul 28, 2013
    Posts:
    26
    Hello

    How I can use 3D Tire? I can't find this feature at your asset.

    Do you still work on your asset? Are you planning to upgrade it, and when?
     
  32. SidarVasco

    SidarVasco

    Joined:
    Feb 9, 2015
    Posts:
    163
    It's probably something really easy but I can't for the life of me find a function that resets the cars engine to full stop and canceling out all forces applied.

    In our game we have a "reset" function to let the player start over but I have no idea how to put the car to a stand still.
     
  33. Hammry

    Hammry

    Joined:
    May 21, 2013
    Posts:
    2
    Hello. What's the difference between UnityCar 2.1 (That in Asset Store) and UnityCar 2.2. Does UnityCar 2.2 have 3D Tire.
     
  34. Milad

    Milad

    Joined:
    Aug 17, 2010
    Posts:
    67
    Hi,
    I have two question:

    1-How car can have fixed speed?when throttleInput have fixed value car's speed will increase and changes gear.

    2-I want to make a chase car to follow another car based on distance.i calculated steer input and works good. How can i control throttle Input based on distance.for example if chase car is farther from main car throttle Input be more and if distance is lesser than 5 meter just follows the main car.

    Thanks.
     
  35. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hi,
    i guess Unity5 is not supported as i see the package has not been updates since 2012 but many people are using it.
    So is it useful inside Unity 5.3 (5.4). And if not is there any plan to update it. Thanks.
     
  36. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Hello,
    UnityCar is already compatible with Unity 5 as it doesn't use any specific Unity 4 features. Upgrades has been paused due to lack of time (full time to another important project which btw uses a new and improved version of UnityCar, Real Drift Car Racing).
    Now Im working on setting up a new and improved UnityCar version that will take advantage of all the expertise acquired by Real Drift Project plus some new cool and AAA features implemented for a new, planned game like:

    1) advanced, physical accurate tire temperature simulation
    2) dynamic track surface (temperature and grip)
    3) different kinds of tire simulation: raycast, rigidbody with joints, soft body
    4) advanced AI.

    The new package will include also everything necessary to manage a racing game (game manager, audio manager etc.).

    Sorry for the lack of news, Im a single developer and I had to manage a couple of issues with my new company and my collaborators.
     
  37. Davidbillmanoy

    Davidbillmanoy

    Joined:
    Jul 7, 2014
    Posts:
    120
    Will the new UnityCar feel better like Edy's?
     
  38. brucektrain

    brucektrain

    Joined:
    Jul 20, 2016
    Posts:
    2
    Hi, Can you tell me how to fix this error?
    "Assets/UnityCarScripts/UnityCar.cs(12,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?"
    After that error shows.

    "Error building Player because scripts had compiler errors" (Was Building to Window Standalone)

    Also I am using Unity 5.3.6


    UPDATE: Other issue when i making custom car.. the default Cars in pack (like skyline etc) Still works in the track. when my custom car enter custom road. and wheels won't even contact the mesh.

     
    Last edited: Jul 24, 2016
  39. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    You keep contacting me asking for support but you dont have a invoice number. Does it make any sense for you?
     
  40. Sondre-S

    Sondre-S

    Joined:
    Jun 29, 2013
    Posts:
    54
    When I instanciate a unity car, I get a NaN error for the input position of the wheels :

    rigidbody.force assign attempt for 'Civic(Clone)' is not valid. Input position is { NaN, NaN, NaN }.
    UnityEngine.Rigidbody:AddForceAtPosition(Vector3, Vector3)
    Wheel:FixedUpdate() (at Assets/UnityCar/UnityCarScripts/Wheel.cs:778)

    Here is my script:
    Code (CSharp):
    1. void LoadCar(string CarName){
    2.     // load car
    3.  
    4.  
    5.      Car = GameObject.Instantiate(Resources.Load(CarName,typeof(GameObject)))as GameObject;
    6.         //Time.timeScale = 0f; // freeze physics
    7.         Car.transform.position=new Vector3(CarLoc.position.x,CarLoc.position.y,CarLoc.position.z);//-CarLocHeightOffset
    8.          Car.transform.rotation=CarLoc.rotation;
    9.  
    10.          Wheel = Car.GetComponentsInChildren<Wheel>();
    11.          for(int i=0;i<Wheel.Length;i++)
    12.          {
    13.          if(Car.rigidbody.active==true)Wheel[i].enabled=true;
    14.          }

    Edit:

    I found that in order to fix this NaN error (which by the way only occurs in the Start() function), you needed to disable the physics and wheel scripts before setting the location and then enable the physics and wheels again.
    If somone knows of a better solution, I'd like to know :)

    The working code:
    Code (CSharp):
    1. void LoadCar(string CarName){
    2.     // load car
    3.    
    4.    
    5.      Car = GameObject.Instantiate(Resources.Load(CarName,typeof(GameObject)))as GameObject;
    6.         // freeze physics disable wheels and set location
    7.         Time.timeScale = 0f;
    8.         Wheel = Car.GetComponentsInChildren<Wheel>();
    9.          for(int i=0;i<Wheel.Length;i++)
    10.          {
    11.          Wheel[i].enabled=false;
    12.          }
    13.         Car.transform.position=new Vector3(CarLoc.position.x,CarLoc.position.y,CarLoc.position.z);//-CarLocHeightOffset
    14.          Car.transform.rotation=CarLoc.rotation;
    15.         // enable physics enable wheels
    16.         if(Car.transform.position==CarLoc.position){
    17.             Time.timeScale = 1f;
    18.  
    19.         Wheel = Car.GetComponentsInChildren<Wheel>();
    20.          for(int i=0;i<Wheel.Length;i++)
    21.          {
    22.          Wheel[i].enabled=true;
    23.          }
    24.         }
     
    Last edited: Jul 28, 2016
  41. speedy19802

    speedy19802

    Joined:
    May 10, 2016
    Posts:
    53
    good day . I sent them a mail with my paypal data,
    purchase unitycar. do not have any mail with download link
     
  42. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Hello,
    the payment is still pending. When the payment will be completed, you'll receive a email with download instructions.
     
  43. Davidbillmanoy

    Davidbillmanoy

    Joined:
    Jul 7, 2014
    Posts:
    120
    Hello! When is the new version coming out? Does Unity Car 3 feel like Edy's? Will Unity Car Enterprise have Turbo?
     
    Last edited: Aug 26, 2016
    MisterAlwin likes this.
  44. CoderPro

    CoderPro

    Joined:
    Feb 21, 2014
    Posts:
    327
    I want to setup a drift car. How can i do this in UnityCar 2.2 ?
     
  45. Davidbillmanoy

    Davidbillmanoy

    Joined:
    Jul 7, 2014
    Posts:
    120
    Hello! I'm worried about Unity Car 2.2 being unsupported. Is it really unsupported?
     
  46. DevOlzhas

    DevOlzhas

    Joined:
    Dec 4, 2016
    Posts:
    14
    Hello Guys! UnityCar has problem with Unity 5.5. Car little bit jumping, especially at high speed.

    Hope Developer will release unitycar 3.0 soon.
     
  47. DevOlzhas

    DevOlzhas

    Joined:
    Dec 4, 2016
    Posts:
    14
    Hello again developers!

    I have checked UnityCar on Unity 5.5.1.

    And there is no jumping as did on Unity 5.5.
     
    MrMetwurst2 likes this.
  48. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hi @newlife , really interested in this. Any news !?
     
  49. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Hello Vagabond, Im sorry but, altough most of those features are already implemented, I dont have time to release my work as a package. Im very busy with the development of my projects on mobile devices. More, it seems that Asset Store earnings are decreasing for most sellers. So, since im a single developer, I have to choose carefully where to spend my time.
     
  50. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Ok, thanks for the response, i wish you keep the good work on Real Drift game !
     
Thread Status:
Not open for further replies.