Search Unity

Assets NWH Vehicle Physics

Discussion in 'Works In Progress' started by NWHCoding, Nov 30, 2017.

?

Which networking solution do you want to see implemented?

Poll closed Jan 20, 2019.
  1. UNet - Unity Networking, getting deprecated sometime in the future

    1 vote(s)
    4.8%
  2. Mirror - Community replacement for UNet (https://github.com/vis2k/Mirror)

    6 vote(s)
    28.6%
  3. Photon

    12 vote(s)
    57.1%
  4. None - I will be implementing my own solution

    2 vote(s)
    9.5%
  1. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    730
    Hello and sorry for not replying earlier - please check post #645 in this thread.

    The stall feature has not been implemented and the clutch at the moment is there mostly as an effect. It is not your bad at all.
     
  2. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    730
    Will investigate this. Any more details on reproducing it? If I understood correctly the sound still loops when you slide from e.g. asphalt to grass and stop there (e.g. sideways)?
     
  3. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    730
    1.9.3 is on the way with the following changes (expect it as soon as it gets approved, most likely tomorrow).
    • Added vehicle auto-setup script.
    • Major improvements to collision detection.
    • Added vehicle collision event.
    • Added sub-material index option to vehicle lights.
    • Added per-gear throttle limiting to make low geared, high power vehicles easier to drive using binary input.
    • Added adjustable auto brake velocity on reverse direction.
    • Added tracked vehicle turn speed limit.
    • Fix GC on WC3D.
    1.9.4 will follow soon after with the changes and fixes for the bug reports above of which I was not aware because #645.
    Otherwise it would all be bundled in 1.9.3 which has already been submitted.
     
    Last edited: Jul 4, 2019
  4. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    730
    You will need to upgrade Unity to 2018.3 or newer to be able to download 1.9.x.
     
  5. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,383
    Glad you're back..to this thread that is .. any cool updates coming? Mirror support? :D
     
  6. Bzuco

    Bzuco

    Joined:
    Sep 6, 2015
    Posts:
    38
    Check this, several times in video with slightly different conditions http://images.bzucko.sk/NWHvehicleSoundBug.mp4
     
    NWHCoding and matees228 like this.
  7. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    120
    HI,

    Just want to let you know the latest version from the store isn't working with unity 2019.1.7f1. I copied the project setting files where they should go but I have load of CS1644 errors.

    Assets/VehiclePhysics/Scripts/Vehicle/VehicleController.cs(107,17): error CS1644: Feature `expression bodied members' cannot be used because it is not part of the C# 4.0 language specification

    Thanks.
     
  8. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    730
    Yes, it is working in 2019.1 but you are using deprecated .NET 3.5 (most likely you upgraded from older version of Unity) which has been deprecated about half a year ago.
    Go to player settings and set it to 4.5 which is the current default Unity setting:

    upload_2019-7-6_23-23-52.png

    Expression bodied member is essentially:
    float MyNumber => _myNumber;
    And it was not supported in .NET 3.5 Equivalent.
     
  9. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    120
    Hi and thank you for the quick reply!

    This solved the problem. I don't know why but somehow my .NET was changed. :)

    The only error I see now is the one below but If I ignore it, I can still hit play.

    Thanks again!
     
  10. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    730
    That one appeared for me after upgrade too. I do not know why it claims it is not a valid name but probably something to do with upgrade process. Usually it goes away after opening and closing Unity.
     
  11. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    730
    Work on 1.9.4 will start on this Friday. I will look to address all the issues mentioned here and the bug reports that I got through email, along with some feature requests (such as event integration). Expect the update to be out in ~<10 days from now.
     
    matees228 and paoloarnolfo00 like this.
  12. mthawley

    mthawley

    Joined:
    Sep 7, 2018
    Posts:
    32
    Excellent! Will FFB be one of the feature requests?
     
  13. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    440
    NWH Vehicle is really great because it provides the best vehicle physics that is realistic but it's also the heaviest.
    I would like an option to dial between simple to full, like LOD so that we can have as many vehicles possible for the AI traffic.
    A use case is that if you drive one of the traffic vehicles, it will use full physics, otherwise, the traffic vehicle will use simple physics. The traffic vehicle may have different levels of physics depends on the view distances.
    I asked about this feature while ago and I believe you also liked.
    Please let me know if it can be supported.
    Thanks.
     
  14. matees228

    matees228

    Joined:
    May 26, 2019
    Posts:
    11
    Could be somehow possible to adjust center of wheel's rotation when editing collision? It always adjusts to center of it.
     
  15. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    730
    I guess you want to wheel to go out of center? There are two ways:
    - Parent the actual wheel to the empty game object and set the empty game object as the wheel. If you want the wheel to be off center move the child (the actual wheel) using localPosition.
    - Move the vertices (slow)
    Now, this will visually move the wheel but will not affect the behavior (i.e the car will not go up and down).
     
  16. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,383
    Mirror support coming? I asked before, and I'll ask again, it's practically unet2 anyway at this point .. really and not sure why it wasn't supported in the first place when the poll came up.. photon pfff
     
    NWHCoding and Willbkool_FPCS like this.
  17. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    730
    It was because the Proton won by getting almost double the votes. Will try to cram it in the upcoming large update.

    Also, there will be 1.9.4 tomorrow during the day due to the bug that was introduced in 1.9.3 and that would apply throttle limiting not matter if "Enable Throttle Limiting" is ticked or not.
     
  18. matees228

    matees228

    Joined:
    May 26, 2019
    Posts:
    11
    Thanks for the response!
    Also, can we get an option to choose specific particle effect for each ground entity? Now there is just smoke. I would like to make mud, grass snow and many others.. I think i could do it myself, but i dont really want to mess with original stuff cause there are updates coming and that would cause mess. Just adding ability to place prefab, that gets applied to each wheel when game is started.
     
  19. matees228

    matees228

    Joined:
    May 26, 2019
    Posts:
    11
    Also, something to report. It seems like the ignore tags for damage dont work. I tried to add tag NODAMAGE for wheel mesh and added it in ignore tags but it still gets damaged. Even tried to attach it to sub Wheel controller colliders..
     
    NWHCoding likes this.
  20. matees228

    matees228

    Joined:
    May 26, 2019
    Posts:
    11
    I just got massive earrape while playing. I'm using 2 audioMixers and i dont know if i can combine these together. This came out from error loger:
    Attempt to set pitch to infinite value from script ignored!
    UnityEngine.AudioSource:set_pitch()
    NWH.VehiclePhysics.EngineIdleSoundComponent:Update() (at Assets/VehiclePhysics/Scripts/Vehicle/Sound/EngineIdleComponent.cs:68)
    NWH.VehiclePhysics.Sound:Update() (at Assets/VehiclePhysics/Scripts/Vehicle/Sound/Sound.cs:253)
    NWH.VehiclePhysics.VehicleController:LateUpdate() (at Assets/VehiclePhysics/Scripts/Vehicle/VehicleController.cs:511)
     
  21. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    730
    Thank you for the report. I am working on the larger update at the moment and all the info helps. It is impossible to catch all the bugs by myself in the testing so such reports are greatly appreciated!
     
    matees228 likes this.
  22. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    730
    The upcoming update will be 2.0 and will bring some of the long-needed changes, along with a list of bug fixes and improvements.

    Here is the new inspector with live preview for the FrictionPreset system that just got a move to ScriptableObject:
    upload_2019-7-13_16-42-38.png
     
  23. matees228

    matees228

    Joined:
    May 26, 2019
    Posts:
    11
    Nice! Can we get something like materials which can make the tire go deeper? Lik wet mud which blocks the wheels?
     
  24. GameDevAcademyy

    GameDevAcademyy

    Joined:
    Jan 11, 2019
    Posts:
    18
    You have a full tutorial for this
    ? , i want to put on my car all details, steering wheel rotation, accelerometer,etc.
     
  25. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    730
    There is no full tutorial video, but there is documentation covering it. I have to admit that such video would be useful and is definitely on my list.
     
  26. matees228

    matees228

    Joined:
    May 26, 2019
    Posts:
    11
    Another bug i've just found. I've made a script which changes 4x4 to 2wd and backward during runtime. It appears that when you have 4x4 and press reverse + handbrake, then swith to 2wd (RWD) and release all buttons, car starts to spin itself on front axle
     
  27. NWHCoding

    NWHCoding

    Joined:
    Jul 12, 2012
    Posts:
    730
    The upcoming update will be 2.0 and it will be quite large.
    There will be a lot of things reworked, new inspector, multiple 'smaller things', multiple bug fixes, etc.
    Still, the biggest one will be the move to modules system where everything but the core functionality will be a module.
    It has been a large problem for customers to add to the asset because things get overwritten - well, that should be fixed from 2.0 onwards. This will also be a solution to the unused modules getting updated needlessly each frame and will allow for easier addition of new modules without cluttering the main code.
    Yes, this will take a bit more time than the 10 days or so I initially mentioned and will break compatibility with previous versions to some extent but I am on it 10+ hours a day so expect it to be out reasonably soon. Still, this has been needed for quite some time and hopefully you do not mind the wait.

    Also, the editor got a bit of a refresh over the past few days:

    upload_2019-7-16_12-28-58.png