Search Unity

Edy's Vehicle Physics - official thread

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

  1. msd1357

    msd1357

    Joined:
    Jul 7, 2014
    Posts:
    8
    Hello,
    How could I add sounds to vehicles?
    Best regards...
     
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    Vehicles already have sounds. Update to the latest version from the Asset Store.
     
  3. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Edy, in the next release we'll be having the missing parts such the engine? or will "just" be the new tyre model and the rest will come later.
     
  4. GameDev_India

    GameDev_India

    Joined:
    Nov 4, 2012
    Posts:
    88
    Can anyone advice me on how to increase the acceleration rate for the Edys Car...

    I have finished a AI with the Car...but its accelerating slow...need some swift high and low acceleration to increase speed quick and reduce ..

    Any help will be great... thanks
     
  5. StenBone

    StenBone

    Joined:
    Dec 21, 2013
    Posts:
    42
    I have a big problem involving scale. I find that if I change the scale to be very large(x20) or very small(x.02) the truck begins to float as if it is in moon gravity and it becomes very slow.

    Does anyone know how to fix this?
    How can I scale the model without changing the physics?

    Also, I am using the GTA Style pickup truck prefab.
     
  6. Moaty1

    Moaty1

    Joined:
    Jul 9, 2014
    Posts:
    2
    hi Edy , is there any way to configure your pack with mobile devices ?
     
  7. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,694
    bought the scripts and love it, but i cant get skidmarks and smoke working for my vehicle, how to enable them?
     
  8. StenBone

    StenBone

    Joined:
    Dec 21, 2013
    Posts:
    42
    I am using EasyJoystick and I want to setup some mobile controls for Edy's Vehicle Physics in my scene. Where is the input code for the cars located within the vehicle prefabs?

    I have looked around the scripts attached to the truck prefab and cannot find the input code anywhere except the class CarMain which is not attached to any of the prefabs. Is the CarMain class included dynamically via scripts?
     
  9. GameDev_India

    GameDev_India

    Joined:
    Nov 4, 2012
    Posts:
    88

    check variables in CarMain steerInput (-1,1) and motorInput(0,1) values range
     
    StenBone likes this.
  10. StenBone

    StenBone

    Joined:
    Dec 21, 2013
    Posts:
    42
    Thanks for the help. That was what I needed. I just didn't know that you could call a static function in a another class that wasn't attached to the Game Object.
     
  11. StenBone

    StenBone

    Joined:
    Dec 21, 2013
    Posts:
    42
    I have another question. I have created classes to extend CarControl and CarMain to add mobile input functionality. I have overridden the Update method in CarControl and the SendInput method in CarMain. My vehicle can drive around and turn normally, but its wheels do not visually rotate when I turn. I can see the wheel colliders rotate in the editor as the vehicle turns, but the wheel meshes do not visually rotate.

    Does anyone have an idea on what might be wrong?
     
  12. StenBone

    StenBone

    Joined:
    Dec 21, 2013
    Posts:
    42
    Where is the code that rotates the mesh of the wheel, not the collider?
     
  13. StenBone

    StenBone

    Joined:
    Dec 21, 2013
    Posts:
    42
    I had to change the type of m_Car in CarVisuals to my extended class of CarControl. Now it works as expected.
     
  14. StenBone

    StenBone

    Joined:
    Dec 21, 2013
    Posts:
    42
    To Edy,

    Did you use Blender for modelling the meshes that are shipped with your package? If you did, could you package the .blend files with the project in the next release so we can see how you set up your models in Blender? I would think that you would have to package them in a zip file to prevent Unity from automatically converting them to FBX. I have tried importing the FBX files into Blender, but unfortunately, that does not work.
     
  15. StenBone

    StenBone

    Joined:
    Dec 21, 2013
    Posts:
    42
    I am constantly getting this exception even though I don't have the script attached to any of my objects.

    UnityException: Input Axis Sideways is not setup.
    To change the input settings use: Edit -> Project Settings -> Input
    CamFreeView.LateUpdate () (at Assets/EdyVehiclePhysics/CameraScripts/CamFreeView.js:101)

    Anyone have any ideas?
     
  16. StenBone

    StenBone

    Joined:
    Dec 21, 2013
    Posts:
    42
    I finally figured it out. There was a freeCamera script in the DriverFrontPivot object of my car prefab.
     
  17. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    Can these cars be used with Physics 2D? (If so whats the best approach?) Tried searching through this thread for this question but its huuuuge.
     
  18. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Hi Folks, whats the best tactic using this prefab to "reduce steering sensitivity"?

    Thanks!
    ~A
     
    JamesArndt likes this.
  19. Calin978

    Calin978

    Joined:
    Aug 5, 2014
    Posts:
    2
    Edy,can you help me adapt this script (Car Main) to Phone?
    Code (CSharp):
    1. if (GUI.RepeatButton(Rect(10,70,50,30),"Click")){
    2.             forwardValue = 1;}
    Say : Assets/EdyVehiclePhysics/CarMain.js(491,25): BCE0005: Unknown identifier: 'forwardValue'.
     
  20. MAGED

    MAGED

    Joined:
    Aug 22, 2014
    Posts:
    9
    i made car by 3d max how to make it move with edy scripts?
     
  21. MAGED

    MAGED

    Joined:
    Aug 22, 2014
    Posts:
    9
    Where can i get this script:

     
  22. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    My bet is from this guy: https://twitter.com/DSadovsky

    Just go to the channel of the video, and choose About to find contact information.
     
  23. NextGen Racing

    NextGen Racing

    Joined:
    Feb 8, 2014
    Posts:
    10
    Hi everyone,

    If you are looking for some good 'optimized' racing tracks contents to test your games & scripts, please give a look at my content, it could be helpful to you & boost your projects.

    NextGen Racing Studio - Tracks Pack

    NextGen Racing Studio Website

    Enjoy & Thanks for anyone interested in my work !!

    P.S.: Contact me if you need a good 3D race track / car modeler or want to merge skills for common projects.
     
  24. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    i'm getting strange exception when i try to import

     
  25. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    Those features (new tire model and full drivetrain simulation) will be part of a different package, as it's a radically different (physically realistic) approach.

    Full doc on all the parameters here:
    http://projects.edy.es/trac/edy_vehicle-physics/wiki/CarControl

    Sure. All vehicles can either read standard Input themselves, or just listen to script-driven input (set CarControl.readUserInput to false). Vehicles expose standard control properties: motorInput, brakeInput, steerInput, gearInput and handbrakeInput. Simply read the values from your touch-based controller and assign them to these properties. Check out the FAQ at the first post.

    Check out the FAQ at the first post.

    No, I've got these models directly in FBX. My intention is to have the Blender sources for all the future models I include in my projects.

    Fixed in the latest version.

    You might try applying constraints to the rigidbodies of the vehicles. Freeze the rotation around the Y axis, and the position on the Z or X axis (depending on the 2D plane you want the vehicle to be constrained to).

    Edit the "Horizontal" axis at the standard input settings (Edit > Project settings > Input). My settings for steering are gravity = 3.5, sensitivity = 2.

    I'd sincerely recommend you to improve your scripting skills and Unity knowledge prior to attempting more advanced developments.

    Use the provided EmptyCar vehicle, located at EdyVehiclePhysics\Prefabs\Vehicles. You can simply replace its visual meshes with yours.

    Fixed in the latest version.
     
  26. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Amm,
    So, being different package means buying appart... right? discount for edy physycs customers may be ? :p.

    Any update on the new package status?
    ///////////////////////////////////

    For rigging a car, I would recommend instead of the dummy car to build it from scratch following the tutorial a russian guy posted somewhere here on this thread. The dummy car messes up with the new geometry and rigging yourself is not that hard, and once you've done one the others will go quite easily.


    EDIT: VIDEO:

     
  27. malyna

    malyna

    Joined:
    Jul 9, 2010
    Posts:
    105
    I would love to see the new pack ASAP :)
     
    Alex_V likes this.
  28. BrightBit

    BrightBit

    Joined:
    Jan 22, 2013
    Posts:
    265
    Hi, in your demo I noticed that the deformation of the cars mesh due to collisions will have holes.
    Did you program this behaviour on purpose? If not: will you fix that?
     
  29. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    Most probably ;)

    That's a feature controlled by a simple parameter in the damage script. Note that the red pickup truck never have holes due to the collisions because it has this feature disabled.
     
  30. tilikum

    tilikum

    Joined:
    Sep 2, 2014
    Posts:
    2
    Hello guys and @Edy,

    I have a quick question, I need to get the duration time of a drift. How can I do that ? I am open to any solutions or idea.

    Thanks.
     
  31. BrightBit

    BrightBit

    Joined:
    Jan 22, 2013
    Posts:
    265
    @Edy: Ah, thank you. I didn't notice that before. But why should someone want those holes? Anyway, thanks for your answer.
     
  32. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Emmm how is the new package coming along?
     
  33. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    Monitoring the sideways velocity is a good starting point.

    It gives a look of broken things, severe damage. Actual "holes" are caused because of the 3D models in the demo don't have an internal non-deformable cage. In properly designed 3D models, those holes would be on the bodywork only, and you would just see "black" through them.

    Truly amazing ;)
    • Tire Friction models: Constant, Smooth, Parametric, Pacejka simplified. To-do: Pacejka'94, anisotropic friction.
    • Differential types: Open, Locked, Viscous, Limited Slip, Salisbury. To-do: torque biasing differential.
    • Engines: Direct drive (constant torque), Inertial Drive (powered rotary mass) + clutch. To-do: standard car engine.
    • Other: Torque Splitter (for AWD), Brakes. To-do: Gear box, Torque converter.
    • Standard bus for all components and external add ons to communicate together (inspired in the ODB-II standard).
    Engines have torque outputs. Wheels have torque inputs. Other components have input & outputs. All components can be arranged and connected in any combination.

    This is my own vehicle physics simulation model conceived, designed and implemented from scratch. Everything in this model is absolutely coherent and provides realistic accurate results even with a single integration step. The system has been implemented around a true physics integration solver. The actual precision of the numeric results depends only on the integration method and the number of integration substeps, which can be configured to any value (even dynamically) with very little and predictable overhead in the overall physics simulation.
     
    Alex_V and GibTreaty like this.
  34. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    5 items in the todo list, probably already started.... Couple of months to start the final debugging....

    Asset for by christmas??:rolleyes:-- Nearly after?:?
     
  35. Theinsanekiller

    Theinsanekiller

    Joined:
    Jun 1, 2012
    Posts:
    27
    Hello Everybody,
    I have be using Edy's vehicle physics since last 2 days. i am new in complex physics like this. What i wanted to achieve is a formula 1 car.
    The thing I want are:
    1. High acceleration, so that it get the high velocity in very less time, I am able to get the acceleration but i am loosing the balance.
    Can you pls suggest some tweaking or the area of scripts where i must lagging.
    Thanx in advance.
     
  36. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
  37. Theinsanekiller

    Theinsanekiller

    Joined:
    Jun 1, 2012
    Posts:
    27
    Is there any thing in the script works as down force or something like that?
     
  38. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    No, but you can easily implement it, something like:

    rigidbody.AddForce(transform.down * rigidbody.velocity.magnitude * downforceCoefficient);
     
  39. OneThree

    OneThree

    Joined:
    Oct 28, 2011
    Posts:
    181
    I bought this a few days ago and have a vehicle up and running in my game, but there is one thing I cannot figure out: how to keep the vehicle from sliding slowly downhill when it is parked on a slope.

    I've read the docs and tried all of the settings I can think of (wheel friction, brake tuning, etc) and for the life of me I cannot keep the thing from sliding unless I crank the Rigidbody's drag value up way high, but that has other consequences.

    I feel like I must be missing something obvious. How do I make the tires stick 100%, so that when it's parked on a slope it won't slide downhill?
     
  40. OneThree

    OneThree

    Joined:
    Oct 28, 2011
    Posts:
    181
    A few more notes, just to clarify what I've tried: Forward and Sideways Wheel Friction are both 2500, as is Static Friction Max. And the brake and handbrake inputs are both set to 1.
     
  41. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    I've been unable to reproduce the problem in the demo. All vehicles rest consistently when stopped in a slope:

    upload_2014-10-24_11-22-20.png

    I recommend you to try the provided prefabs directly in your scenery. Also, check out the physics materials. For surfaces with full grip (asphalt, concrete) try removing the physics material from their colliders.

    Vehicles take the surface's grip from the friction values of the materials. The package provides sample physic materials (grass, offroad, sand, car's body) you can use as base for yours. When no physic material is assigned to a surface, it's assumed that surface to provide full grip.
     
  42. OneThree

    OneThree

    Joined:
    Oct 28, 2011
    Posts:
    181
    Cool, thanks for the quick reply! I should have mentioned before that I'm seeing these results on terrain, not normal flat surfaces. Maybe that's having an effect?

    Anyway, I dropped a stock Pickup prefab into my scene and made only 3 changes:
    1. Disabled 'Read User Input' so that the car wouldn't be controlled by the player.
    2. Set 'Brake Input' to 1.
    3. Set 'Handbrake Input' to 1.
    When I ran the game, I got this: https://www.dropbox.com/s/cd8343uz9l6ds0b/SlidingTruck.mp4

    I checked, and the terrain has no Physics Material on it, which sounds like it should provide full grip.

    Any ideas for new things to try?
     
  43. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    Ok, I found the issue. The terrain collider is detected a bit different in the code, as in recent versions of Unity the terrains wouldn't report their physics material.

    Open CarWheel.js and find the definition for globalTerrainFriction. Set it to 1.0 for providing full grip. By default it's set to 0.4, which explains the vehicle sliding.
     
  44. OneThree

    OneThree

    Joined:
    Oct 28, 2011
    Posts:
    181
    I made that change, but the prefab is still sliding down the terrain. :-/ It is sliding slower than before, but it's still sliding. Anything else I can try?
     
  45. Lord_Meshadieme

    Lord_Meshadieme

    Joined:
    Oct 30, 2014
    Posts:
    6
    Is this working on Unity 5?
     
  46. OneThree

    OneThree

    Joined:
    Oct 28, 2011
    Posts:
    181
    Any update on this?
     
  47. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    No, Unity 5 breaks the compatibility with the WheelCollider component.
    I'm working on a brand new Vehicle Physics package for Unity 5. Please check out the FAQ at the end of this blog post:

    http://www.edy.es/dev/2014/11/early-preview-of-vehicle-physics-pro/

    I haven't had a chance of testing the problem yet, sorry. Will try as soon as I could find some time.
     
    Alex_V likes this.
  48. malyna

    malyna

    Joined:
    Jul 9, 2010
    Posts:
    105
    Show me the price and i show you the money! :)

    EDIT: Oh i see the price in FAQ :)
     
    Last edited: Nov 4, 2014
  49. davbar9

    davbar9

    Joined:
    May 19, 2014
    Posts:
    62
  50. S0ULART

    S0ULART

    Joined:
    Jun 14, 2011
    Posts:
    131
    Hi Edy just wanted to ask

    1.
    what happens to all buyers that buy Edy Vehicle Physics and Unity 5 arrives. Will there be a free upgrade to the new Unity 5 compatible version or how will it be solved?

    2.
    Is it possible to achieve some kind of arcadeish racing style like in the Sonic Racer


    or even floating vehicles? like in Star Wars Racer ?


    sincerely
    Soul