Search Unity

Edy's Vehicle Physics - official thread

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

  1. alargastudio

    alargastudio

    Joined:
    Apr 18, 2017
    Posts:
    11
    sorry to ask mr edy, if you dont mind can you tell me where i should put this code in vehiclecontroller, thanks
     
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    You may write a separate script that applies that torque to the vehicle's rigidbody. No need to modify the EVP code.
     
    alargastudio likes this.
  3. devotid

    devotid

    Joined:
    Nov 14, 2011
    Posts:
    445
    Edy I have been getting a few users having the golf cart will lose its "wheels" and resting on the primitive colliders. I have three similar vehicles that are setup the same way and they all "changed" at the same time. (I updated Unity from 5.6.3 to 2018.2)

    I cant get my own editor or my own builds to replicate it. :(



    I dont change anything at runtime on the vehicles. You can "tow" the cart home. When I tow it, I just make the rigidbody Kinematic and moves it position and rotation and then make it non kinematic again. Its a way to get the cart unstuck from cruising around the island. But I think the vehicle is already in this state when the game loads and users are trying to reset the cart home.... and it still is like the picture and not fixed.

    Any idea what I should start looking at? Layers? Maybe turn something on and off to get the wheel raycaster to reset?

    I started this project 3 years ago on 5.6.3 and just finally took an entire month and upgraded the project to 2018.2 (What a NIGHTMARE) and Edy physics were one of the only things that updated flawlessly. haha

    Thanks Edy. People are loving the vehicles in the game. So thank you again. :)

    Kevin
     
  4. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,272
    Does EVP support headlights, i. e. lights for driving at night? If so, can someone please point me to the documentation? I couldn't find anything about it. Thank you very much!
     
  5. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    That's probably an issue with the vehicle collider. The collider should enclose at least the top half of the wheel collider component.

    Additionally, there's some ground behind the one that is visible? I've found that sometimes when there are two planes on top of another, the WheelCollider may miss the collision with the plane in the top and "look for the collision" of the bottom plane. This is usually fixed by splitting the ground colliders into smaller chunks.
     
  6. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    It's not included in the package but you could perfectly add headlights to your vehicles. Simply add two (or more) spot lights and a script for controlling them.
     
  7. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,272
    Thanks, I already have that, but I was hoping more for an in-built solution with the head lights actually shining, similar to the brake lights. Same with tail lights. You know, changing the materials.
     
  8. devotid

    devotid

    Joined:
    Nov 14, 2011
    Posts:
    445
  9. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,272
    Thanks, but I really like the solution which exists already for the brakes. I guess it's easy and straightforward to implement the same for the head lights and the tail lights. However I do prefer a solution in the asset itself, especially because it would be beneficial for other customers as well. It gives additional value with little effort. And for the other, I wouldn't want to re-implement it over and over whenever the asset changes.
     
  10. devotid

    devotid

    Joined:
    Nov 14, 2011
    Posts:
    445
    "the ground colliders"? You mean the terrain colliders. I dont use mesh for the ground. I use Unity terrain. Im not chunking up my terrain.... I am still adjusting. (Though Im not sure thats what you meant)

    I do have two Unity terrains overtop of each other but one doesnt even have a collider. Could the raycast still be catching it? Even without a collider?

    Side Note: The van in the background is just a static mesh. Golf Cart is the only Edys Car in the game.
     
  11. superoir

    superoir

    Joined:
    Jan 21, 2017
    Posts:
    1
    Not sure if this has been answered here, but does anyone have a free-body diagram or any notes on the car's forces? It doesn't need to be over the top details, but if anyone can point me to the right scripts or places that would help. I've seen in the documentation of modifying parameters, but not really going in depth on how they work. I'm specifically interested in what's being used for the drag forces and acceleration and if there's any wind resistance being applied or other forces I'd need to look into. Thanks in advance.
     
  12. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,272
    The VehicleNitro.cs script of EPV isn't advertised enough, I only found it by accident. And had to try :D



     
    Last edited: Feb 9, 2020
  13. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,272
    Done. It does make a difference :)



    Script is attached in case anyone else needs it.
     

    Attached Files:

  14. siumanchun

    siumanchun

    Joined:
    Apr 7, 2013
    Posts:
    44
    Hi !
    Please edys vehicle physics Please Add Manual gear And Car Ai ( Not simple AI ) !

    Thank You !
     
    Last edited: Feb 19, 2020
    UnityGames99 likes this.
  15. KayJ_sh

    KayJ_sh

    Joined:
    Apr 14, 2019
    Posts:
    6
    Hi, I have several vehicles in my scene that can be driven. The user can switch between vehicles. Dependent on the chosen vehicle I want the inputs for the other vehicles to be blocked. My current approach is to enable/disable the VPStandardInput script. This works fine so far. But when starting the scene every script is enabled even though it is disable in the prefab. How is this possible? Even if I disable it in the Start() method it gets enabled before Update() is called. This behaviour is only related to this specific script. How can I get rid of this behaviour or what else can I do to disable the input for a specific vehicle?
     
  16. AntLewis

    AntLewis

    Joined:
    Feb 2, 2010
    Posts:
    254
    Hey @Edy, just bought the package, looks great. Quick question - I want the vehicle to accelerate automatially, with the player controlling the steering. In the Vehicle Standard Input, how should I go about this? I'm setting forwardInput to 1 but it's just idling. Thanks!
     
  17. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    AntLewis likes this.
  18. xsasoftware

    xsasoftware

    Joined:
    Sep 6, 2017
    Posts:
    24
    Hello, I bought your asset to use in a drift simulator. I want to make a score counter when you are in drift. Can you give me a point where i can hook to get a bool if i'm drifting or not in your vehicle controller code? Thank you :D
     
  19. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    521
    Is it recommended to write a custom input controller for EVP or just use the included script? I can’t imagine I’d need any particular part of it changing, other than to be able to turn on and off input during scene intros or after finishing, and I’m not sure what others using EVP would generally do.
     
    devotid likes this.
  20. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    178
    Any Update on this ?

    Thanks
     
  21. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    No, sorry. I haven't yet found a straightforward way of integrating multiple ground materials in a single terrain.
     
  22. Slimmy

    Slimmy

    Joined:
    Apr 25, 2017
    Posts:
    21
    Hi!

    I'm having issues with the Tire Marks Renderer component. Quickly summarised the issue appears when a vehicle skids over two separate meshes. One is a terrain and one is my road. The skidmark glitches and shoots off into infinity, it would seem. Not entirely sure when the glitch appears. There is possibly a gap between the road and the terrain surface. Has this happened to anyone else?

    Screenshot:
    https://drive.google.com/file/d/1WC8adFRap7NwgMZAQdL_Wuca-S2uRpIA/view?usp=sharing
     
  23. hellstorm

    hellstorm

    Joined:
    Jun 29, 2015
    Posts:
    41
    Greetings Edy!

    i was just wondering if there was any issues with running at 80hz or higher ? 0.0125 timestep, you mention
    "supports any physics timestep up to 0.06 for saving CPU." is this a hard cap or will it work with VR in higher refresh rates like 80,90,120,144 ?

    when using steamvr, it trys to set to hmd frequency for smooth physics ( as you can change the hz on the fly in valve index)
    Time.fixedDeltaTime = Time.timeScale / vr.hmd_DisplayFrequency;
     
  24. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    111
    upload_2020-11-1_17-58-16.png
    Hi,I am having issues using Steering Assist on one of my car as its SpeedAngle is not straight.I checked the wheels,they are all facing forward. Im using unity 2019.4.9f1. Is there any way to fix this?
     
  25. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    111
    upload_2020-11-1_20-30-3.png
    I found what causing the bug.Whenever I set rear suspensions higher than the front,the speed angle changes.I think it is caculating the speed angle for X axis that than Y, causing the Steering Assist to malfunction.
     
    zabsv likes this.
  26. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    111
    upload_2020-11-2_0-54-39.png

    I fixed it by editing the m_speedAngle calculation within VehicleController.cs
     
    zabsv likes this.
  27. batvink

    batvink

    Joined:
    Sep 26, 2019
    Posts:
    61
  28. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    111
    batvink likes this.
  29. batvink

    batvink

    Joined:
    Sep 26, 2019
    Posts:
    61
    Thanks for the suggestion. Is it essential to have a Nav mesh for the AI in Realistic Car Controller? Or can you just set it to follow a target?
     
  30. Karifan

    Karifan

    Joined:
    Aug 22, 2019
    Posts:
    4
    Hi Rowlan, Thanks for the lights, indeed :) A question : What is the int 'emissionMaterialIndex' ?
     
  31. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,272
    It's the material that gets replaced / toggled. There's a material with lights on and lights off.
     
  32. Slimmy

    Slimmy

    Joined:
    Apr 25, 2017
    Posts:
    21
    BUMP

    Anyone who might be able to point me in the right direction regarding this? Would be very grateful.
     
  33. Slimmy

    Slimmy

    Joined:
    Apr 25, 2017
    Posts:
    21
    Sorry for spamming the thread. But is there HDRP support for the EVP shaders/materials? Any suggestion on how to go about converting the materials/shaders to HDRP?
     
  34. DirtyHippy

    DirtyHippy

    Joined:
    Jul 17, 2012
    Posts:
    224
    Is there a setting to prevent the vehicle from automatically righting itself? Even if it lands upside down it will flip back over which sometimes feels quite wrong. I always thought that was kind of cool, but now I would like to either stop it or mitigate it.
     
  35. Slimmy

    Slimmy

    Joined:
    Apr 25, 2017
    Posts:
    21
    I know you can manipulate this behavior through the center of gravity of the vehicle. Try that first. There is also some sort of self-righting system built in EVY. Try and fiddle with those settings. I believe they have to do with anti-rollling. However, I can not verify at this moment since I do not have access to a a computer.
     
    Last edited: Dec 6, 2020
  36. unitynosf

    unitynosf

    Joined:
    Jun 9, 2014
    Posts:
    23
    Hello all;

    We're using EVP for years now, and I really just like to start off with saying: great physics! No dobut about it.
    Recently, we're developing a game which has specific needs and I find it tricky to figure out, perhaps @Edy or someone can pinch in with some thoughts / ideas. Would be very appreciated, thank you in advance.

    It's about collisions and way cars react on collisions.
    Typically, it's pretty good as is, however in this specific case I need to set up cars so that when a collision between 2 moving cars happens - they react as minimal as possible - by not flipping/budging/or similar. Movement speed we're talking about is like 50-70 km/h, nothing too big.

    To explain better, let's take an example where car #1 at 60km/h hits idle car #2 from side - like in a door or something.

    A) Current case:
    - Upon collision, I am able to get different results (obviously related to speed itself) - like from sometimes flipping the car fully or partially and some possible position change.

    B) What I'd need (ideally):
    - Upon collision, cars stop but do not move if possible, or slightest possible (movement/rotation-flip).

    In the settings, I wasn't yet find a combination to get this, antiroll seems to be helping of course, but changes like moving CoM much lower or increasing rigidbody mass - seem to produce mixed results - or there's a bunch of other changes that need to go with those.

    I guess question is: would there be any EVP setup options that would give a car sort of "super stability" or should I look more into Unity engine then (rigidbody, drags, etc)? Considering how EVP controls a lot about behaviour of the car in fact, I thoguht to ask here too for some help/ideas.

    Thank you for reading
    Regards
     
  37. Slimmy

    Slimmy

    Joined:
    Apr 25, 2017
    Posts:
    21
    I guess applying some sort of amplified downforce could work with a constant force being applied. Having a very low center of gravity of the vehicle would also improve its stability, of coarse. But probably not exactly the behavior you're looking for.
     
  38. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    111
    As far as I know,it uses Nav Mesh. I don't know about following target. The new version has police chase,so maybe look into that script.
     
  39. Dave_LeDev

    Dave_LeDev

    Joined:
    Apr 14, 2015
    Posts:
    33
    I can't seem to find any documentation on this feature; does this asset currently have any support for vehicles with less than 3 wheels?
     
  40. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    111
    best to just use motorcycle physics .Since this is for cars,body roll is opposite that of motorcycles.
     
  41. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    Anyone using Edy's Vehicle Physics with Rewired?
     
  42. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    838
    @Edy is it possible to have joystick controls that are absolute? E.g. micromachines, when i push my joystick left the vehicle will turn to the world-left and continue ahead?
     
  43. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    Yes, for example you could do 2-wheel trailers. If you're thinking about motorcycles, you could configure two wheels but the equilibrium is not implemented, so it will fall on its side.
    Yes, but you have to code an input component that does that explicitly. It would translate the joystick position to a world direction, then calculate the steering input of the vehicle so the wheels point to the given direction.
     
    TJHeuvel-net likes this.
  44. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    838
    Thanks for the quick response!
     
  45. serberusno1

    serberusno1

    Joined:
    Jan 28, 2017
    Posts:
    84
    Is this still working with the latest version of Unity? want to upgrade from 2017 version that I've been using for way too long now
     
  46. Dave_LeDev

    Dave_LeDev

    Joined:
    Apr 14, 2015
    Posts:
    33
    Are there any near or far future plans to implement equilibrium within the package?
     
  47. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    Yes, it has been tested in Unity 2018, 2019 and 2020.
    Not at this moment. I'm developing motorbike equilibrium for Vehicle Physics Pro, but it's unclear if/when it will be working. This topic is of huge complexity. Even if it finally lands in VPP, I don't think it will be implemented in EVP.
     
  48. Vaupell

    Vaupell

    Joined:
    Dec 2, 2013
    Posts:
    302
    This asset is amazing, just started using it.

    The demo vehicles work great, however creating a new vehicle it partial working, i can see springs, wheels etc is working, but the car is just stuck not moving, almost as if it kinematic (it is turned off)

    So i triied taking the L200 demo car, and just replace the mesh, but then that wont drive.
    Wheels are turning, and steering is working.
    Also ensured it's NOT scaled in anyway, it is one of the vehicles from Synty polygonTown pack.


    However car is physically not moving, but the other demo cars work great..

    Any ideas?

    EDIT: NEVER MIND, i found there spherecolliders on the mesh, preventing movement..
    removed those and off we go :D

    #amazingAsset
     
    Last edited: Feb 9, 2021
    Edy likes this.
  49. seconddaytv

    seconddaytv

    Joined:
    Jan 22, 2020
    Posts:
    9
    Hello everybody! I currently consider buying this asset but I am curious if the asset allows me to create cars feeling similar to the cars in Trackmania.
    I specifically need cars that handle well at high speeds and allow controllable slides at high speeds, just like in this video.



    Would EDY's Vehicle physics be a fitting asset for this type of handling?

    Thanks in advance!
     
  50. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    It might serve as starting point, but EVP won't provide that handling alone. Trackmania cars are sort of a mix between car physics and character controller. It looks and seems to behave like a car, but the gameplay and player mechanics are strictly defined by rules you would put in a character controller.