Search Unity

Edy's Vehicle Physics - official thread

Discussion in 'Assets and Asset Store' started by Edy, Jan 19, 2012.

  1. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    @PatrickKa Try using low poly meshes, or reducing the damage radius. Each collision requires to traverse all vertexes in the mesh, then modify the positions of those affected by the impact.

    @PvTGreg The C# port for the package version 4.3 is available upon request. Latest version is JS only, but the scripts can be used from C# code directly.
     
  2. PvTGreg

    PvTGreg

    Joined:
    Jan 29, 2014
    Posts:
    365
    @Edy its just that when i try to acces the javascripts it does work
     
  3. PatrickKa

    PatrickKa

    Joined:
    Apr 30, 2014
    Posts:
    245
    Alright, thank you. But I got another question that is in on my mind for a very long time now. What are the requirements for the engine sound?

    I really would like to use some other sounds that match the power of the car (V8, V12, etc.) but the sounds I tried usually sound like an approaching alien mothership. Do you have some ideas how to modify sounds to make them work or where to buy some good working sounds? Or other ideas?
     
  4. Kirienko

    Kirienko

    Joined:
    Apr 5, 2013
    Posts:
    37
    You have to move the scripts to the "Plugins" folder.

    From the readme:

     
  5. Jaejun-Lee

    Jaejun-Lee

    Joined:
    Sep 4, 2013
    Posts:
    3
    I want to make the main camera stay at same side rather than go to reverse side when a car moves backwards. Where should I modified?
     
  6. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    Modify the CamSmoothFollow.js script.
     
  7. Jaejun-Lee

    Jaejun-Lee

    Joined:
    Sep 4, 2013
    Posts:
    3
    Can you be little bit more specific. I'm quite novice for scripting. Thanks in advance
     
  8. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    354
    You can turn off follow velocity on the CamSmoothFollow script from Inspector.
     
  9. Jaejun-Lee

    Jaejun-Lee

    Joined:
    Sep 4, 2013
    Posts:
    3
    Thank you. You saved my time
     
    hakankaraduman likes this.
  10. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    354
    Your welcome
     
  11. petak_core

    petak_core

    Joined:
    Nov 19, 2012
    Posts:
    57
    Hello @Edy
    I tried Edy's Vehicle Physic in Unity 5 and there is some problem with physics, or I think its about new Physix system in Unity.

    But I found this cool video Edy's Vehicle Physic for Unity 5.


    Do you know when will be out new "optimized" version package for Unity 5

    Thank you
     
    Last edited: Mar 6, 2015
  12. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
  13. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,372
    I want to use the upcoming Vehicle Physics Pro package for aircraft landing gear physics simulation. I guess the only difference with a car is that the experienced weight is dynamic. So will it be possible to dynamically change the weight?
     
  14. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    Absolutely. The custom VPWheelCollider component in Vehicle Physics Pro is configured by specifying spring rate, damper rate and suspension distance. Wheels will react to the weight (any downforce) as expected.

    Vehicle-Physics-Pro-Wheel-Collider.png

    Moreover: the wheel is accurately simulated at inertia level based on the specified wheel mass, even in unpowered wheels. When the aircraft makes contact with the ground it will experience a brief drag caused by the tire friction and the wheels suddenly having to match their rotation rate with the ground.

    Unpowered wheels can work passively and still benefit of the steering, brakes and tire friction features:

    Vehicle-Physics-Pro-Vehicle-Controller.png

    Vehicle Physics Pro is is a Work In Progress project. Actual status, documentation and roadmap are here:

    http://vehiclephysics.com/
     
  15. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,372
    Thanks. Looks good!
     
  16. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Will you have a discount for owners of this package to your new vehicles physics pro package?
     
    OnePxl likes this.
  17. PatrickKa

    PatrickKa

    Joined:
    Apr 30, 2014
    Posts:
    245
    My cars don't go straight. They all drift to a side without steering input. I already aligned all wheels. How can I fix this?
     
  18. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    I hope you add a "CanControl" or "Controlling" boolean so that I can enter and exit the vehicles super easily.
     
  19. pinchmass

    pinchmass

    Joined:
    Jul 2, 2012
    Posts:
    156
    any update on they unity 5 update (is it still on track for 1st April) fingers crossed
     
  20. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
  21. blitzlightning

    blitzlightning

    Joined:
    Mar 23, 2015
    Posts:
    1
    Hello. I am trying to play Edy's Vehicle Physics on the game website Y8.com, but whenever I play it, the game freezes while loading. Then, there's a window that says "The following plug-in is unresponsive: Unity Web Player." And the game crashes and I have to reload the page. I tried to uninstall and re-install the web player, but it doesn't work. I tried to disable and enable the program, but it doesn't work. I heard that it has to do with Chrome not supporting NPAPI anymore, but it still doesn't work on Internet Explorer or Firefox. And also, when I try to play any other Unity games on the site, it still has the same problem. Do you guys have any advice on this?
     
  22. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    Hi,

    One noob question. I'm trying to implement mobile controls using UI but I have a problem, on top of CarMain script, why there are no using UnitaEngine etc, I need to put using UnityEngine.UI but it doesn't work.
     
  23. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    Sure, contact me including your invoice number and I'll give you a discounted price.

    Ensure all suspension settings are symmetrical. Also check out whether the vehicle contains a Rigidbody in some of its children. My example vehicles include a small rigidbody (1kg) to simulate the inertia at the driver's view.

    Input is provided by a separate component. Enabling / disabling this component makes the input control the vehicle or not.

    Yes, package is already submitted to the store and it's under review. It's up to them to have it reviewed for April 1st.

    JS scripts don't have to include UnityEngine, and the "using" keyword is incorrect. Use "import" instead.
     
    John-G likes this.
  24. pinchmass

    pinchmass

    Joined:
    Jul 2, 2012
    Posts:
    156
    hi just got the update for Unity 5 thanks a millions work fine, but a few questions.......

    any ETA on the damage system (could seem to find it in the later update) I know you mention features will be added.

    Also can the reverse command be set to the same key as breaking (once stationary),

    sorry to pester sure you just want to get the next version finished, but until then I just having to use the current one.

    keep up the great work
     
  25. toto2003

    toto2003

    Joined:
    Sep 22, 2010
    Posts:
    528
    hello, was testing edy s asset, my car got stuck on his roof when it s upside down while doing some stunt, is there a way to bring it back on his wheels?

    cheers great assets!
     
  26. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    Will be ready really soon now. I'm working hard this month to bring all the features from the previous version.

    Hit Return ;)
     
    OnePxl likes this.
  27. ZiadJ

    ZiadJ

    Joined:
    Sep 3, 2011
    Posts:
    62
    Is there going to be any love for Logitech G25/27 owners in the final release of Vehicle Physics?
     
    Alex_V and llJIMBOBll like this.
  28. ferikh

    ferikh

    Joined:
    Apr 6, 2015
    Posts:
    2
    im,when import package to unity 5 give me error :
    Assets/EdyVehiclePhysics/CarInput.js(177,56): BCE0051: Operator '!=' cannot be used with a left hand side of type 'System.Object' and a right hand side of type 'UnityEngine.LightShadows'.
     
  29. screenracer

    screenracer

    Joined:
    May 9, 2011
    Posts:
    112
    @Edy I am having an issue where the wheel is not rotating, but the car is moving. The visual meshes are virtually not spinning with the wheel. What am I missing?
     
    Last edited: Apr 8, 2015
  30. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    I'll begin experiments with G27 at some point at Vehicle Physics Pro. Can't estimate a date, as there are some key features in the simulation system that are still to be completed.

    You must download the latest version using the Asset Store window in Unity 5. This will import the correct version.

    Configure the Wheel Transform in the Vehicle Controller's wheels list:

    upload_2015-4-9_11-0-4.png

    The transforms configured there will steer and spin at the position of the wheel.

    EDIT: Also ensure that both DriveForceToMaxSlip and BrakeForceToMaxSlip are greater than zero. I'll add validation to these fields in next version.
     
    Last edited: Apr 9, 2015
  31. Ozge-Carikci

    Ozge-Carikci

    Joined:
    Aug 9, 2013
    Posts:
    3
    Hi @Edy, when I try to import package to new project, Unity 5 gives me these errors:
     
  32. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    @Ozge Carikci Update Unity to a recent version. EVP requires Unity 5 RC2 or later.
     
  33. Vibs_appit

    Vibs_appit

    Joined:
    Feb 16, 2014
    Posts:
    53
    Hi Edy,
    I have been using EVP for a week and loving it. I was struggling to get my vehicles working properly for my game in Unity5, but then I got your package and converted all of my systems to work with EVP. I got most of the stuff working, but my vehicles slip even with small angle at speed. when I am barely more than half my maxspeed and I want to take a turn, it just drifts 180 on me. What things I need to consider in order to take turns properly? my speed is in the range of 25 to 40 for different vehicles, but they all behave the same, so I figured it's something to do with slip values but I can't figure it out. I am attaching a sample vehicle controller here: Screen Shot 2015-04-11 at 10.33.23 am.png

    Any help is appreciated! Thanks man!
     
    Last edited: Apr 11, 2015
  34. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    @Vibs_appit Upgrade to the latest version. Includes new aerodynamic properties that should prevent the problem. You can specify separate drag / downforce coefficients and an application point. For example, applying the downforce/drag 1m behind the center of mass will give the rear wheels more grip with speed, preventing that slip effect.

    New version also includes all vehicles properly configured, including the sport coupe.
     
  35. Vibs_appit

    Vibs_appit

    Joined:
    Feb 16, 2014
    Posts:
    53
    Thanks for the reply, Edy! I am updating them now. Are any of the properties changed that I should be aware of i order to update without breaking my current project?

    Cheers!
     
  36. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    The package is in "beta" stage, so there might be some changes in the behavior when updating projects. Most changes in the latest update come from the aerodynamic properties. Ensure to understand them and tweak your vehicles accordingly. I recommend you to check how the configuration of the example vehicles.
     
  37. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    762
    Hi Edy,

    Whenever I press play, the wheels on my car move away from the correct location. All gameobjects in the scene are at a scale of 1,1,1 , however I do use a scale factor of 0.35 when importing the asset.

    They also don't rotate correctly around their own axis, they rotate around the parent object at the top of the car hierarchy.

    I get this behaviour if I setup from scratch on my own models, or even if I use the L200-Blue and swap out the meshes, then realign things properly.

    What am I doing wrong?



    and
     
    Last edited: Apr 14, 2015
  38. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    @Carwashh check out this video on the correct procedure for setting up vehicles from scratch:

     
    OnePxl likes this.
  39. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    762
    Thanks Edy, with the help of this video I've worked out why I was getting the odd behaviour. It's because the wheels for my models have their pivot points at 0,0,0, so all 4 wheels have pivot points that are at 0,0,0 and moving the wheel colliders (manually) to align with the wheels puts their transform in a difference place.

    I've fixed it by putting the wheel meshes in an empty gameobject each, which has the correct transform.
     
  40. comp

    comp

    Joined:
    Mar 28, 2013
    Posts:
    1
    Edy, your Physics are the most helpful platform I've been able to find, not to mention your support is second to none. So thank you for that! I highly recommend the package and Edy is just great to work with.
     
  41. tkoknordic

    tkoknordic

    Joined:
    Jan 31, 2013
    Posts:
    93
    Is there documentation how to use VehicleCameraController component? My camera movement isn't any where near "smooth". What does the damping values do?
     
  42. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    @tkoknordic Ensure the rigidbody for your vehicles has an "Interpolate" mode other than "None".
     
  43. tkoknordic

    tkoknordic

    Joined:
    Jan 31, 2013
    Posts:
    93
    It was already as inpterpolate (I used the prefab from the package). Anyway your answer got me a hint that it's because of physics frames so I changed timestep value in Time settings from 0.02 to 0.01 and all sudently camera movement was nice and smooth :)
     
  44. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    @tkoknordic That shouldn't be necessary. I've tested the package to work fine even with timestep = 0.06. Can you reproduce the problem in one of the provided example scenes?
     
  45. hemantp

    hemantp

    Joined:
    Feb 10, 2015
    Posts:
    15
    Hello Edy,

    We have work on game like side wheel hero. In that we have requirement for lift the car on two wheel. how to do this stuff using your asset. we have used your asset for physics but does not find any solution,

    Please Guide us, Give me your valuable suggestion.
     
  46. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    @hemantp Do you mean driving the car on two side wheels? Can you provide an screenshot or video? Also, please let me know the version of Unity you're using.
     
  47. mkgm

    mkgm

    Joined:
    Apr 10, 2015
    Posts:
    134
    Hello @Edy, do you have an estimated time for the stable version of EVP 5?
     
  48. hemantp

    hemantp

    Joined:
    Feb 10, 2015
    Posts:
    15
    Hello Edy i added screen shot lift the car on two wheel, i have to do same thing in our how to do it using your asset please suggest us ?

    We are using unity version 4.6.1f1
     

    Attached Files:

  49. hemantp

    hemantp

    Joined:
    Feb 10, 2015
    Posts:
    15
    also when lift the car on two wheel then it is stable for on two wheel unless user give any input how to do this stuff using your asset?
     
  50. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    @hemantp Ok, I'm a big fan of that trick. Some thoughts:

    A car on two wheels is unstable per-se. A bike has a specific design that makes it stable above a minimum speed. But a car in that position requires the driver to constantly apply small corrections in order to keep it that way. A simulation would require a specific script to keep the vehicle stable when user is not applying any input.

    If you're using EVP in Unity 4, then you can simulate the two-wheel trick. The suspension in the WheelCollider reacts correctly. Check out this video, the trick is demonstrated around second 15:



    Note how that the vehicle is realistically unstable on two and requires corrections to the steering.

    In Unity 5... well. PhysX 3 Vehicle SDK has been designed to address a specific situation working under very tight specifications. As consequence, it fails or works badly in most others. The WheelCollider component forcefully applies all the suspension force in the Up direction of the vehicle. This means that when the vehicle is on two wheels, the suspension applies a big part of its force laterally, causing the vehicle to slide sideways. This video shows the problem clearly:



    There's no solution in Unity 5 WheelCollider, as this part depends entirely on PhysX 3. My long-term plan is to develop my own suspension simulation and completely abandon the WheelCollider component.