[RELEASED] 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.

  1. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    namoricoo UnityCar doesn't use weel colliders, uses a custom improved wheel model (3d tires, customizable suspensions with real world value, realistic tire forces). You just need to create a new GameObject (or select your car model), click on Components/Physics/UnityCar and everything is setup automatically (scripts, wheels GameObjects and a standard box collider 4X1.5 meters). Now you are ready to drive your car.
    if you want to use a mesh collider, you have to choose your car model and create a mesh collider based on that (and remove the box collider if present).
    Im going to make a tutorial video soon, meanwhile you can have a look to the tutorial on the wiki:

    http://unitypackages.net/unitycar/wiki/index.php/Creating_a_car
  2. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    yes, we tested an external DLL (so it will be PC only) and it seems to work
  3. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    Im happy to announce that finally UnityCar 1.2 is on the Asset Store: :)


    [​IMG]
  4. screenracer

    screenracer

    Member

    Joined:
    May 9, 2011
    Messages:
    69
    We have been working to create our own car bodies and we ran into 2 issues. One problem we were able to fix on our side. Example, Some of sample cars bend (the red demo car), while other "fracture" (the yellow demo car). Even one the first minor dent to cars caused the car body to fracture, make it look like every face on the model is broken - Making the car body look un-smooth. The problem was with the max 9 fbx exporter. We had to use the free FBX converter program to fix this problem. We just opened our FBX model in this program and re-saved it. Once we did this it fixed this issue. I would assume newer versions of the fbx importer wont have this issue. (link: FBX Converter)

    Our current problem is that the car body will separate bases off of the unwrap from an impact. The front of our 3d car is unwrapped into several parts, each part will break away on impact. Is there a way to fix this and keep the car body welded as one piece? Thanks!
    Last edited: Oct 18, 2011
  5. Daladier

    Daladier

    New Member

    Joined:
    Jun 18, 2011
    Messages:
    48
    I have a problem with the correct settings of Unity input manager. Can you make screenshot(s) of your project settings? Thank you.
  6. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    the yellow car fractures cause its a simplified model (it has been simplified (maybe too much :) ) to lower file size)

    what do you mean exactly? i cant understand
  7. RandAlThor

    RandAlThor

    Member

    Joined:
    Dec 2, 2007
    Messages:
    804
    Like iKKe i would be happy if there will be a simple ios project in the not so far future please.
  8. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    UnityCar Input Manager is included in the package (you have to copy it in your Library folder). If you don't have it you can download it here:
    http://unitypackages.net/unitycar/InputManager.asset
    Last edited: Oct 20, 2011
  9. ikke

    ikke

    New Member

    Joined:
    Jan 23, 2008
    Messages:
    7

    The InputManager was present in the Library, I replaced with this one to be sure, still no succes.

    On the carDynamics script I choose the 'Mobile conrtroller', on play it switches to 'Axis', and the Mobile Car Controller script deactives itself?!
  10. GameReady3D

    GameReady3D

    Member

    Joined:
    May 19, 2011
    Messages:
    73
    Hello NewLife,
    I saw your techdemo part 1 video, and noticed the nice drifting you did with the blue car. I can't seem to do it when I play your demo. Do you have to use a steering wheel controller and pedal to drift? Special setting on the car? I noticed that the car "snaps loose" and spins when I loose grip. Overall, fantastic job on version 1.2. I'm considering purchasing it. It would be a bonus if I can drift it. Cheers...
  11. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    Are you using StartGame.cs? If so, keep in mind that StartGame.cs has been written to build the online demos, so by default it set controller to axis (that is joystick and keyboard). Deactivate StartGame.cs.
    PS: obviously only one carcontroller can be activated at the same time, so if cardynamics finds two controller activated, it deactivates the one not chosen.
  12. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    The drifting part of that demo has been done with the mouse, without changing the standard setting. Using the keyboard is more difficult (even if is possible). Try using the mouse, or even better with a steering wheel
  13. Daladier

    Daladier

    New Member

    Joined:
    Jun 18, 2011
    Messages:
    48
    I have a problem with the car deformation, the original car works, but not on my car. It looks like a problem with layers, because if the original car has assign a layer, deformation stop works.
  14. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    Daladier the problem lays on the fact that CarDamage doesn't apply damages to all GameObject with layer the same layer of Wheels GameObject (this is because damages applied to wheels look weird). So if wheels and car body share the same layer, damages aren't applied to neither to Wheels and to car body GameObjects. I just fixed this problem, meanwhile you can avoid this problem assigning a different layer to wheels respect to car body (like in the example cars). Contact me on unitycar@unitypackages.net or skype michele.dilena in order to receive the new CarDamage script.
  15. Daladier

    Daladier

    New Member

    Joined:
    Jun 18, 2011
    Messages:
    48
    Fixed, thank you very much.
  16. Costy

    Costy

    New Member

    Joined:
    Sep 27, 2011
    Messages:
    65
  17. GameReady3D

    GameReady3D

    Member

    Joined:
    May 19, 2011
    Messages:
    73
    NewLife,
    I purchased UnityCar from your website 3 days a go, I have not received the download link. Check your PM. Thanks
  18. jeffmorris

    jeffmorris

    New Member

    Joined:
    Nov 26, 2009
    Messages:
    144
    I tried out UnityCar and I have a suggestion or two:

    When stopping the vehicle, it goes into reverse if I don't release brake/reverse key as soon as it stops.
    When I go into Input Manager, I found out that I can assign the clutch to a button or joystick axis. Using the clutch does nothing.
    I would like rear-view mirros.
    My Logitech G27 racing wheel has clutch pedal and H shifter.
  19. InterstellarGames

    InterstellarGames

    New Member

    Joined:
    Jul 5, 2011
    Messages:
    17
    Hi I love the physics in this, you should really consider making a bike / motorcycle 2 wheeled extension. That would be AMAZING. You may even be able to tweak the current version and just use 2 wheels. Anyways great stuff!
  20. Wolfos

    Wolfos

    Member

    Joined:
    Mar 17, 2011
    Messages:
    648
    All demos are now 404 not found.
  21. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    this is wanted. if you want to avoid this, you can disable automatic transmission. If you mean that you want to avoid this behavior with automatic transmission too, I can add a flag called auto reverse.

    we tested the clutch pedal with a G27 and it worked. Contact me on skype if you still experience this issue.

    its very easy to implement rear view mirrors, you just need to add one or more cameras and set it accordingly.
  22. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    tried right now and they all work
  23. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    its not very straightforward to extend UnityCar in order to simulate 2 wheeled cycles. you have to simulate gyroscopic effects and great tyre inclination (pacejka tyre model doesn't support inclination higher that 30 degrees).
    Anyway, if there is enough interest, i can start develop a version dedicated to 2 wheeled cycles.
  24. jeffmorris

    jeffmorris

    New Member

    Joined:
    Nov 26, 2009
    Messages:
    144
    Please add the auto reverse flag. What does the clutch supposed to do? I will try adding mirrors to the vehicles.
  25. jeffmorris

    jeffmorris

    New Member

    Joined:
    Nov 26, 2009
    Messages:
    144
    I tried to add cameras for mirrors to vehicles but I always get the first car's mirror view.
  26. MooseMouse

    MooseMouse

    Member

    Joined:
    Sep 14, 2011
    Messages:
    426
    I'm using UnityCar 1.2 in my game. Very happy with UnityCar :)

    But, I am having a strange problem. In automatic mode, the gears occasionally "stick" at the high rpms instead of shifting into the next higher gear. If I let up on the gas and then press it again it sometimes shifts. Also, sometimes doing this makes it act like it is in a higher gear, but the gear has not changed.

    It is very apparent when using car #2 in my game (the muscle car):
    http://moosemouse.com/btr2_demo

    I have tried tweaking the gear ratios, min/max/shiftdown rpms but nothing seems to fix it. Any ideas what is happening?

    Thanks,
    Shawn
  27. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    Hi
    Sawn,
    I tested your (nice) game and it seems that the problem is due to slipping clutch. You have to increase clutch torque in drivetrain.cs, or leave it to 0 (in this case is calculated automatically from engine torque).
    Let me know if this fix your problem.

    Regards,
    Michele

    PS: I also tested big time racing 1, you used flash right? How did you succeeded in creating such a high quality 3d graphics with flash?
  28. MooseMouse

    MooseMouse

    Member

    Joined:
    Sep 14, 2011
    Messages:
    426
    Hi Michele,

    You are correct, the clutch was slipping. But I had the clutch torque set to zero and it was calculating automatically. I think my problem is that I have tweaked many other areas of the physics.. I set gravity up to -20, so I double hp. I also have very cartoonish cars with huge, fat tires that would destroy most clutches given enough hp. So, for some reason even when I manually cranked the clutchMaxTorque up to a huge number, 1000000000f, it still slipped. It seems to be getting hung up on this equation in the clutch > GetDrag:

    Code (csharp):
    1. if (Mathf.Abs(engine_speed - drive_speed) < (threshold * normal))
    2. {
    3.      locked = true;
    4.      return 0;
    5. }
    Sometimes it just can't satisfy that "if". So I hacked it as follows:

    Code (csharp):
    1. if (Mathf.Abs(engine_speed - drive_speed) < (threshold * normal) || (rpm > 0.75 * maxRPM))
    2. {
    3.      locked = true;
    4.      return 0;
    5. }
    I am sure there is a better way to handle this, but I don't fully understand the car physics yet. Anyway, this seems to work so far, so I am happy.

    ***********************************
    As far as the Flash 3D in BTR 1, that was an exercise in cutting corners. 15fps, no lights/shadows/reflections, wrote my own stripped down physics engine, lots of L.O.D. swaps, frustum culling, and of course no environment. I was happy to get it to work at the time, but it really pushes Flash Player 10 to the limit. Much happier using Unity and having all this extra power :D
    ***********************************

    Thanks,
    Shawn
    Last edited: Nov 29, 2011
  29. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    Its really strange that clutch is still slipping even with very big clutchMaxTorque values.
    Which function are you using to calculate engine torque? if you are using the internal function (loadExternalTorque set to false) keep in mind that its a simple function that in some particular case can cause problems. Try to use an external torque file (like explained in the wiki).
    Also, do you really need to increase gravity? Is it not enough to increase car's weight? Im telling you this cause BTR2 cars doesn't behave naturally during jumps.

    i thought you were using away3d with bullet physic engine..
  30. MooseMouse

    MooseMouse

    Member

    Joined:
    Sep 14, 2011
    Messages:
    426
    I am not yet using the torque curves, I will give that a try. As for my crazy high -20 gravity setting, I will rethink that, too. The jumps felt too "floaty" to me at -9.81, even though it is real world accurate.

    *************
    BTR1 uses away3DLite, but my own physics :)
    *************
  31. dgutierrezpalma

    dgutierrezpalma

    Member

    Joined:
    Dec 22, 2009
    Messages:
    402
    I don't know if it will help in your game, but that "floaty feel" is usually caused by the "drag" value of the Rigidbody. In UnityCar, it would be possible to use a Wing component to increase the vehicle downforce... and it should be possible enable or disable that Wing component (depending on if the car is on the ground or not) if you only want to have the wing downforce when the car is in the air.
    Last edited: Nov 30, 2011
  32. MooseMouse

    MooseMouse

    Member

    Joined:
    Sep 14, 2011
    Messages:
    426
    Hmmm. thanks for the idea. I will check out the rigidbody drag. The "floaty feel" I don't like is when the car is jumping/falling. It just seems too slow. I notice it in a lot of physics based games, and I know some other people share my opinion. Of course, I have never jumped a car at 100mph, so I don't have any real frame of reference ;) Increasing the gravity is a technique that at least a few other people I know of use. But it definitely creates some new problems.
  33. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    with "floaty feel" do you mean that the car is not controllable after a jump? do you want to obtain a behavior like this?
    Or you just mean that your game is feels "slow motion"? If this is the case, maybe this is caused by the fact that you are using bigger scale than real life (a car should be 4 X 1,5 meters).
    This is explained well here
  34. MooseMouse

    MooseMouse

    Member

    Joined:
    Sep 14, 2011
    Messages:
    426
    Thanks for the links. By "floaty" I mean the gravity feels low, like they are driving on the moon (or someplace with gravity half-way between moon and earth). The Burnout video is mostly slow-mo, so I can't really tell if that is what I am after.

    It may be a problem of scale, but I used your cars as a starting point and just switched out my car body and wheels for yours. So my cars are basically the same size as yours, except mine have cartoony proportions. Actually, in my opinion the cars in the UnityCar demos are a bit "floaty", too. This all may just be due to my warped perception of reality ;)

    But as an example, I am working on a track with a huge (10 story) loop. If I set the gravity to -9.81 a car can successfully drive through it at only 60 mph (which is.. umm.. not very fast in km/h). I've never driven on a loop, but I don't think that is realistic. It certainly doesn't "feel right", which is even more important.

    To sum up, UnityCar is great :) I am very happy I purchased it! My physics issues are definitely separate. I will take another look at things, and I may post the loop example later today to, ahem, *prove* my point ;)

    Thanks,
    Shawn
  35. Shigidy

    Shigidy

    Member

    Joined:
    Dec 14, 2011
    Messages:
    410
    Hi, I just bought your product as I was really intrigued by this cool product. I'm really new to this product and I dont' even know how to make the cars move. Like I really have no idea where to add the scripts. Like I see the cars in the city, but I can't move them. Sorry about this really newbish question, but I'm just really new and have no clue.

    Thanks
  36. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    did you try the included demos?
  37. Shigidy

    Shigidy

    Member

    Joined:
    Dec 14, 2011
    Messages:
    410
    Hey, when I try the demos and hit play it goes to the car and none of the controls work. Any ideas.
  38. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    contact me on skype michele.dilena
  39. Shigidy

    Shigidy

    Member

    Joined:
    Dec 14, 2011
    Messages:
    410
    Sorry about the long wait in between posts. I've been sick and had a sinus infection, just got some anitbiotics, way better. About the game, when I try to open one of the four pre-made demos it goes to the cars and I can switch in between them and I hear the sound engines. But I can't steer them with the directionals. It says at the bottom Unity Exception: Input Axis Throttle is not set up. As you can probably tell I'm extremely new to making games. Also I would go on Skype, but I don't have a webcam. Thanks for the help.
  40. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    you have to copy the file "InputManager.asset" (you can find it in the folder "InputManagerSettings") in the "Library" folder of your project.
    Anyway this is described in the readme file included with UnityCar
  41. Shigidy

    Shigidy

    Member

    Joined:
    Dec 14, 2011
    Messages:
    410
    Hey,

    I'm sorry I'm just very new to this area and I just trying to see some progress. I've read the read me file and the wiki and I'm still at a loss. I'm sorry for my ignorance, but I was just hoping you could help me a little further. It says just copy the Unity Car Scripts in the Script folder. I don't know what the script folder is or where it's at. Do I have to make a new script folder?

    All I see is the Unity Car Script on the project side that includes Aerodynamic Resistance to Drive train and under that I see materials that include Mobile Car Controller to Wing. On that same side I do see input manager settings, but when I hit the down arrow it's filled with 3D models I bought from Turbosquid. Than on the hierarchy side I see the car collection. Do I need to do anything with that?

    Finally, If I click on the car then Component and then Unity Car it says "Losing Prefab adding a component will lose the prefab parent".

    Is there anyway you could make a baby steps instruction manual to help me finally get these cars moving with your cool physics. Sorry about being a headache.

    Thanks,
  42. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    contact me on skype: michele.dilena
  43. pats

    pats

    New Member

    Joined:
    Mar 25, 2011
    Messages:
    6
    HI,

    I just got UnityCar. I'm still getting familiar with it. Looks real good, there's just a lot to figure out for getting this running on the iPhone.

    I have a scene with a car (ferrari for now) and a rough plane for a track. Runs real good with skidmarks and all in preview, but when I change platform (in car dynamics) to mobile, I no longer have those great skidmarks. Are skidmarks supported for mobile devices? I have Unity iPhone... not pro.

    Thanks for the great product

    Pats
  44. Shigidy

    Shigidy

    Member

    Joined:
    Dec 14, 2011
    Messages:
    410
    Hey pats how did you get your cars to move, like I can't get them to move at all.
  45. pats

    pats

    New Member

    Joined:
    Mar 25, 2011
    Messages:
    6
    Shigidy,

    Mine didn't move at first. How I found it was, I changed the camera angle and I saw the tires were sinking through the track, but the car wasn't??? I realized this was with the layers collision as noted in the docs. I put the track on it's own layer, and the car and the wheels on another, and viola the car is moving.

    Hope that helps

    Pats
  46. Shigidy

    Shigidy

    Member

    Joined:
    Dec 14, 2011
    Messages:
    410
    Thanks for the help pats and New Life, I finally got the cars moving and their great. I just want to say how helpful NewLife was and took the time to personally help me. Would recommend this product just for his help alone.
  47. pats

    pats

    New Member

    Joined:
    Mar 25, 2011
    Messages:
    6
    Michele AND UnityCar Rocks!!!
    Last edited: Jan 16, 2012
  48. newlife

    newlife

    Member

    Joined:
    Jan 20, 2010
    Messages:
    559
    hi pats my skype is always active. When did you contact me on skype? I didnt receive any message from you.
    Anyway skidmarks should work on any platform. Controller input should work well too on the Iphone.
    Please contact me again on skype in order to solve your issue.
  49. pats

    pats

    New Member

    Joined:
    Mar 25, 2011
    Messages:
    6
    I just had a support session with Michele via skype, and I have to say.... He gives AMAZING support for his UnityCar asset.

    Thanks again Michele
  50. joschy3d

    joschy3d

    New Member

    Joined:
    Jun 2, 2010
    Messages:
    23
    Hi,
    we just purchased the nice UnityCar package and it is a great one :)
    We must controll a short racing game with the Logitech G27 Racing Wheel and want to shiftup and down manual. There are rocker switch on the racing wheel and a gear shift controller. How must we setup the Input Manager? Or must we setup a controller config for the racing wheel?

    tia