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

Edy's Vehicle Physics - official thread

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

  1. Deleted User

    Deleted User

    Guest

    Maybe in a basic form, no need for thousands of lines of coding. So you could also advertise this not only as a car controller but also for motorbikes and bicycle controller. Please ^^
     
  2. libra34567

    libra34567

    Joined:
    Apr 5, 2014
    Posts:
    62
    Hi sir, i tried out the demo and really like your asset. However i have one question in mind, can i customize the driving parameters? As i would like to use it on fast phasing tank game.
     
  3. speedy19802

    speedy19802

    Joined:
    May 10, 2016
    Posts:
    53
    Good Day . Can they help me code for manual transmissions?
     
  4. Deleted User

    Deleted User

    Guest

    Why do you not reply @Edy, not even replying to my PM?
     
  5. John3D

    John3D

    Joined:
    Mar 7, 2014
    Posts:
    441
    Is this package still being developed? Does it has a mobile controller? Thanks!
     
  6. CoderPro

    CoderPro

    Joined:
    Feb 21, 2014
    Posts:
    327
    Drift car unstable, very difficult to drift car. I hope @Edy can config for easy drift car.
     
  7. RolfBertram_dot_me

    RolfBertram_dot_me

    Joined:
    Mar 1, 2011
    Posts:
    128
    Update: solved with: distance -= VehicleCameraController.pinchValue * distanceSpeed;//RB

    Trying to use EasyTouchControl with "Pinch" to control camera distance in orbit mode, instead of mouse-wheel. Calling a function with EasyTouchTrigger "public void Pinch(float pinch){pinchValue = pinch;}, which I placed above "ResetCamera()" in VehicleCameraController.cs. So far, so good. However, getting the pinchValue into the Update function "distance -= pinchValue * distanceSpeed;" does not work. It seems "public float pinchValue;" is either valid only for "Pinch()" or only for "Update()", depending on where I put it. I could not figure out how to make it valid in both areas.
     
    Last edited: Jun 29, 2017
    Edy likes this.
  8. CoderPro

    CoderPro

    Joined:
    Feb 21, 2014
    Posts:
    327
    What are you talking about ?
     
  9. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,497
    Yes, everything is exposed and can be configured.

    I've been out for travel and had little time. I cannot work right now on an equilibrium script, sorry. It will be available in a future version.

    Yes! Version 5.2 was pushed recently to the store. There's no mobile controller included yet, but the vehicles can be controlled from scripting in a very easy straightforward way. The cross-platform controller included in Unity's Standard Assets may also be adapted easily. Next version will include an example of mobile controller.

    Really? I've just played it a while and works like a charm, in both flat and uneven terrain, high and low speeds, etc. Maybe is a problem with the input setup? I'd recommend you to configure Horizontal and Vertical axis like this:

    upload_2017-7-3_19-29-38.png
     
    John3D and CoderPro like this.
  10. CoderPro

    CoderPro

    Joined:
    Feb 21, 2014
    Posts:
    327
    In the next update, could you add mobile controller using accelerator for drift or control car ? Thanks in advanced.
     
  11. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,497
    A mobile controller is planned. What do you mean with "using accelerator for drift or control car"?
     
    John3D and CoderPro like this.
  12. CoderPro

    CoderPro

    Joined:
    Feb 21, 2014
    Posts:
    327
    Ah, sr @Edy, I mean, using Accelerometer input to control. I think using Accelerometer input will easier to drift car than using UI buttons.
     
    John3D likes this.
  13. CoderPro

    CoderPro

    Joined:
    Feb 21, 2014
    Posts:
    327
    Hi @Edy,
    In EVP, How can i tuning for drift car or any racing type car ? Like camber, suspension at runtime ...etc
     
  14. RolfBertram_dot_me

    RolfBertram_dot_me

    Joined:
    Mar 1, 2011
    Posts:
    128
    Wheel steering not working during jump?
    For long jumps it is visually irritating. Sometimes the wheels steer just to one side, sometimes they suddenly change steering direction several times during one long jump. Is there an easy solution to this?
     
  15. Deleted User

    Deleted User

    Guest

    What happened with the included digital speedometer, i have the 5.2 version, and i don't know how to add it. Anyone can help me? Please.
     
  16. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,497
    Most parameters may be adjusted in runtime. Only changing the number of wheels requires the vehicle to be disabled.
    More hints on drifting setups here:
    http://evp.vehiclephysics.com/faq/#how-to-configure-a-car-for-drifting

    Maybe, but not necessarily. The final result depends on the handling settings. For example, the Steering Assist settings automatically counter-steers while drifting.

    This is probably caused by the Steering Assist setting ensuring the wheels are properly steered before the vehicle lands. A possible workaround is reducing / disabling the Steering Assist setting when airborne.

    It was removed when porting the package from Unity 4 to Unity 5. A new speedometer will be included in the next version.
     
  17. DariusRusu

    DariusRusu

    Joined:
    Oct 20, 2014
    Posts:
    16
    Hi Edy,

    I love your package, i m trying to find out a vehicle AI that follows the checkpoint but i didn t find anything
    do anyone know a tutorial or a script for this
     
  18. CoderPro

    CoderPro

    Joined:
    Feb 21, 2014
    Posts:
    327
    Hi @Edy ,

    How i can edit camber angle for drift cars ?
     
  19. RolfBertram_dot_me

    RolfBertram_dot_me

    Joined:
    Mar 1, 2011
    Posts:
    128
    How can I erase all tire-marks without re-starting the scene?
     
  20. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,497
    Thank you!
    The Unity Standard Assets package provides an example of a car following a waypoint given by mouse click. I think it would be easy to adapt the script to control EVP vehicles.

    In EVP you edit the car's handling directly. What's the expected result of modifying the camber angle in a real car? For example, if the understeer/oversteer balance is affected, then you can edit that balance directly in the Understeer / Oversteer parameter.

    TireMarksRenderer.Clear()

    Note that typically there are several TireMarksRenderer components in the scene.
     
    Last edited: Aug 14, 2017
  21. RolfBertram_dot_me

    RolfBertram_dot_me

    Joined:
    Mar 1, 2011
    Posts:
    128
    TireMarksRenderer.Clear

    Note that typically there are several TireMarksRenderer components in the scene.[/QUOTE]

    Problem: Scene does not start - without error message in console. It exits play-mode right after I click the start-scene button. And the lines of code in question should not even execute, since I did not call ClearTireMarks() yet.

    Code (CSharp):
    1.    
    2. using EVP;
    3. ...
    4. public TireMarksRenderer tiremarksSkidmarksScript;
    5. public TireMarksRenderer tiremarksOffroadScript;
    6. public TireMarksRenderer tiremarksSandScript;
    7. ...
    8. void ClearTireMarks()
    9. {    
    10. if (tiremarksSkidmarksScript.isActiveAndEnabled){tiremarksSkidmarksScript.Clear;}
    11. if (tiremarksOffroadScript.isActiveAndEnabled){tiremarksOffroadScript.Clear;}
    12. if (tiremarksSandScript.isActiveAndEnabled){tiremarksSandScript.Clear;}
    13. }
    14.  
     
  22. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,497
    tiremarksSkidmarksScript.Clear();
    It's a method call. Edited.
     
  23. dasfuhrer

    dasfuhrer

    Joined:
    Apr 29, 2017
    Posts:
    11
    hi EDY i have bought your unity asset and followed your youtube tutorial but i have a problem that the wheel collider at first when i click adjustwhellcoliders to their meshes they dont adjust perfectly the position is right but the radius of the whell coliiders is bigger than the wheels , and then the problem when i press play the wheel collider collide with the real wheels

    this is a photo about it , i hope you can help me
     

    Attached Files:

  24. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,497
  25. dasfuhrer

    dasfuhrer

    Joined:
    Apr 29, 2017
    Posts:
    11
    okay , also i have problems with the vehicule tire effect and the ground material manager scripts , i didnt find any docs to how to use them ... !
     
  26. GameDveloper09

    GameDveloper09

    Joined:
    Dec 24, 2015
    Posts:
    9
    hi
    how i can make physics like this thank you
     
  27. dasfuhrer

    dasfuhrer

    Joined:
    Apr 29, 2017
    Posts:
    11
    i have sent an email but no respond !!!
     
  28. dasfuhrer

    dasfuhrer

    Joined:
    Apr 29, 2017
    Posts:
    11
    my current problem is that when i accelerate from 0 to 30 km/h the wheels take some rotation sometimes to the left orr to the right , with no respond and no support i will ask for a refund !
     
  29. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,497
    @dasfuhrer I'm pretty sure that I've answered all the emails I've received so far. Let me know if this is not your case (feel free to PM your email) and I'll review it thoughtfully.
     
  30. Tonismo

    Tonismo

    Joined:
    Oct 7, 2016
    Posts:
    29
    Hey Edy,I am dissecting your scripts.It is very easy to read,with good comments.I am adding real gears,power curve,and suspension height.Just like Unitys standard asset cqr controlle,I have the mesh follow the wheelcollider transform instead of wheelcollider follwing Mesh Transform.I have tried many car physics,but yours come out on top.Unitys own wheelcolliders are confusing,I cant figure out its logic even after months of research .Perhaps it is broken....

    Why didnt you implemented gears ,power curve,ride height from the beginning?I see you are adding these features in the new Vehicle Physics Pro.I cant wait to try it out.Please leave long readable comments in your future scripts.I want to tinker with it.Thanks!
     
  31. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,497
    @Tonismo thanks for letting me know.

    Can you elaborate on this? I think the current method is correct.

    Because vehicles in EVP are configured in terms of gameplay: max speed, acceleration, handling... It's much easier to just define a top speed and an acceleration curve rather than having to deal with engine curves, gear ratios, and so on.

    So the core physics adhere to the "easiest way of doing things" style. Other features may be added via add-on scripts. Indeed, I plan to include manual gears in EVP. Of course, this will be an optional feature provided via add-on script, so it may be easily ignored if not required.
     
  32. Tonismo

    Tonismo

    Joined:
    Oct 7, 2016
    Posts:
    29
    Hey Edy,if you look at the Standard Assets carcontroller script.The wheel mesh transforms follows the Wheel Colliders.Its easier for me this way because in my game,tires ,wheels and brakes get removed and added on as parts.I dont have to use raycasts or anything.
     
    JamesArndt likes this.
  33. Praetorsoft

    Praetorsoft

    Joined:
    Oct 9, 2016
    Posts:
    14
    Hi, I've been using this asset for a long time and I think it's awesome. But I just upgraded to Unity 2017.1.2 and I'm sorry to report that something is not right.
    I create a new project, add a terrain, add Edy's Vehicle Physics. From the prefabs I add the "Sport Coupe Drift", "Ground Material Manager" and "Camera Controller". I start the game and start making donuts with the car. Unity crashes completely within seconds.
    It seems to have something to do with the Ground Material Manager and VehicleController. If I set groundMaterial = null; in VehicleController.UpdateGroundMaterialCached() (so that it cancels GetGroundMaterial()) then it seems to work. Or if I set an actual physics material in Element 0 in Ground Material Manager. It's null in the prefab. I did not have to do this in Unity 5.5 that I used previously.
    Unity's error.log gives: Write to location 00000000 caused an access violation.

    Update:
    I have sent this to Unity and they have been able to reproduce the bug.

    Update 2:
    Unity has confirmed a problem with the particle emitter system. A patch will be created but will take a while before release. They say it's a problem with the particle system when it uses a Size module and calls Emit from script on the same frame that the system was created.
    I temporarily removed the particle emitters from the Ground Material Manager and the crashes stopped.
     
    Last edited: Oct 11, 2017
  34. DariusRusu

    DariusRusu

    Joined:
    Oct 20, 2014
    Posts:
    16
    Hi edy

    Can you please tell me how can i put a precise ps numer like 130ps in your car physics, by the motor i can only use the drive force speed
     
  35. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,497
    The standard assets use WheelCollider.GetWorldPose, which I don't use for several reasons. For example, it's not interpolated so the wheels look like stop-motion at slow time modes. Also, the position of the wheel may go beyond the actual limits of the suspension. EVP uses either the GroundHit information or a RayCast for finding the precise position of the wheel, depending on the setup.

    Many thanks for reporting! I've already Tweet'ed a warning on this for users.

    Vehicles in Edy's Vehicle Physics are configured in terms of gameplay and behavior. There are no real parts simulated here (engine, gearbox, etc). You can only configured the final force that will be applied by the wheels, and the acceleration curve that decreases that force with the speed. You might simulate an actual engine by writing an add-on component that does all those calculations and finally adjust the parameters in the VehicleController so the wheels receive the force that you've calculated, but I think that would be overkill. If you need to use precise real-world parameters I recommend you Vehicle Physics Pro instead.
     
    JamesArndt likes this.
  36. Davidbillmanoy

    Davidbillmanoy

    Joined:
    Jul 7, 2014
    Posts:
    120
    Nice, i want an addon component with engine, gearbox, drivetrain, differential, and advanced suspension.
     
  37. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,497
  38. DariusRusu

    DariusRusu

    Joined:
    Oct 20, 2014
    Posts:
    16
    I think i am going to buy your vehicle physics pro when it comes out for standard version,
    is there gonna be a proper car audio, like pro 1000 rmp different audio, so you can get a better and realistic sound?
     
  39. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,497
    This is a planned feature, but won't make it into the first version. I already have some high quality sound sets for this.
     
  40. MoribitoMT

    MoribitoMT

    Joined:
    Jun 1, 2013
    Posts:
    301
    Hi,

    I am keep getting this error sometimes in editor and sometimes in runtime. It does not effect gameplay, however I just want you to know ( using Unity 5.6.4p1 )

    Screen Shot 2017-11-07 at 10.14.31.png
     
  41. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,497
    Thanks, but I couldn't reproduce the issue. The EVPParticleShadows.cginc file is there. You may try reimporting EVP.
     
  42. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
    Hi Edy,

    Can you use your EVP with vehicles at very small scales? My game requires toy vehicles at real world scale. Testing with default wheel colliders and tweaking values produces some weird results in unity. I just havent been able to reproduce a decent car at smaller scales. I've removed any scale values from the hierarchy (rigidbodies, collision meshes etc)

    Was wondering if EVP would simplify the process and allow more accurate results. I want exactly what I see in your demo, but at 0.1 size.

    If you're reply is "yes", have you tested it on your end and do you have a sample setup for a standard car at 0.1 scale compared to the full size samples included in your asset? I have a fully functioning "small" car, but its not behaving as well as a "full size" car I have also tested... so I can get the results I want with standard Unity assets/WheelColliders on a full size car, but not when scale down. I would be purchasing EVP purely to remove the headache of setting up smaller scale vehicles, so you understand I want to check for sure before I purchase.

    Thanks in advance
    Cheers
    Richie
     
  43. Duetschbag

    Duetschbag

    Joined:
    Jun 12, 2014
    Posts:
    10
    I'm new to playing around with networking and wondering if you have any documentation, tutorials, other people's tutorials, etc. that can point me in the right direction for setting up a basic multiplayer game with EVP?

    I'm using Unity's built in networking components, but so far all I can do is get the vehicle movement synchronized. Wheel spin, damage, etc. doesn't seem to synchronize between the two clients.
     
    MarkusGod likes this.
  44. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    I've noticed weird snapping occurring with a steering wheel with the VehicleVisualEffects.cs applied to it. To explain better this is happening when hitting the left and right arrow on the keyboard, rapidly turning the wheel from left to right or vice versa. I can't really tell but it looks like it's snapping to a zero value and then rotating.
     
  45. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,497
    JamesArndt likes this.
  46. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Yep and this wasn't even an issue from your package. I'm overriding the input using Racing Game Starter Kit. The RGSK overwrites all of the Input Manager settings when it's imported.
     
    Edy likes this.
  47. BackburnerGames

    BackburnerGames

    Joined:
    Dec 7, 2017
    Posts:
    5
    JamesArndt likes this.
  48. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Ha ah that looks awesome! You've answered the question I had in my mind in which I was wondering if Edy's physics could be used for an offroad game similar to Super Off Road or something. Definitely looks like it can. I've also implemented testing his physics in my karting project and it's getting there. It implements easily into the racing system I am using and is getting pretty close. Still trying to get it to be more stiff like a real kart and to kind of "hop" or "skip" when sliding or going over bumps. I haven't done any real artwork yet, just placeholder stuff for spatial awareness.



    This is a direct download link to the latest build:

    https://www.dropbox.com/s/dfu1axzh9tmcgor/SKR_12-7-17_615PM.zip?dl=0

    Please feel free to try it out and let me know what you think about the handling and/or physics. Don't get too caught up in any artwork as it's all placeholder geometry and textures at the moment.
     
    SirTwistedStorm likes this.
  49. BackburnerGames

    BackburnerGames

    Joined:
    Dec 7, 2017
    Posts:
    5
    Lol, nice!
    Yes...it took a lot of tweaking to get the feeling I was going for. Sometimes, working with Edys is like trying to tame a wild powerful beast!
     
    GreeneMachine and JamesArndt like this.
  50. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,497