Upgrade Notes
Upgrade notes between different version of NWH Vehicle Physics 2. Version of currently installed package can be found under the Package Manager (Window > Package Manager).
It is always best to do a clean import after upgrade by removing the NWH folder and then importing. Doing this will not break the project in any way, or cause missing scripts, as Unity keeps the references.
11.x to 12.x
- Clean import is recommended (delete NWH folder and import again from Package Manager)
WheelController:
- WheelController `rotatingVisual` and `nonRotatingVisual` fields were replaced in favour of `Rotating` and `NonRotating` empty GameObjects to which wheel parts can be attached:
- To upgrade select `Upgrade from v11` button - the containers will be created and objects from `rotatingVisual` and `nonRotatingVisual` parented to their respective containers:
- To upgrade manually click on `Generate Visual Containers` and drag the wheel GameObjects in the Hierarcy view to the containers.
Differential:
- v12 uses a single differential with adjustable settings.
- To mimic previous differential types:
- Open
- Stiffness = 0
- LSD
- Stiffness > 0
- Slip torque ~200 (for a typical car)
- Locked
- Stiffness = 1
- Slip torque > 1000 (too high values might cause instability so keep the value only as high as needed to get the desired behavior)
- More info under updated Differentials page.
11.10f to 11.11f
- Clean import required due to the resources that were moved.
10.x to 11.x
- Minimum Unity version changed to 2020.3.40f.
- Clean import required.
- Powertrain components will need to have their outputs re-assigned.
- EngineStartComponent was renamed to EngineStartStopComponent. StateDefinition settings for EngineStartStopComponent will need to be re-assigned.
- Clutch type is now an enum and will need re-assigning if other than Automatic (default).
9.x (1.9.x) to 10.x
- <fc #ff0000>MAJOR UPDATE</fc>. Clean import required. Remove the NWH folder completely before importing, including any other NWH assets.
- Unity 2021.3.16f or newer required!
- Check the Changelog for a more detailed list of changes. Only the changes affecting functionality are listed here.
Wheel Controller 3D
- WheelController3D has received a major rewrite, minor tweaks might be needed to adjust the behaviour.
- New, cleaner, API. Scripts referencing WC3D will need to be updated.
- Force Coefficient and Slip Coefficient have been renamed to Grip and Stiffness.
- Rim Offset was removed.
Vehicle
- NRigidbody was removed. Physics substepping is no longer used/needed and Project Settings > Time > Fixed Delta Time should be adjusted instead if higher physics fidelity is required. Recommended: 0.01 (100Hz) to 0.01667 (60Hz) for desktop, 0.02 to 0.03 for mobile and WebGL.
- Vehicle Controller > Settings > Physics Properties center of mass and inertia were moved to the optional VariableCenterOfMass script. VehicleController no longer sets any Rigidbody properties so mass, drag, angular drag, etc. need to be set on the Rigidbody itself.
- Anti-roll bar was removed in favour of 'Force Application Point Distance' on WheelController. Higher value equals less lean.
- PWR > Transmission > Type > Automatic Sequential was removed. Use Automatic with Is Sequential option enabled instead.
- Clutch might need adjustment since the PID settings were replaced with the clutchEnagementRPM and clutchEngagementRange fields. Clutch engagement is now instant.
- Engine running sound might need pitch adjustment due to the way pitch is now calculated (from 0 RPM instead of idle).
- Wheel camber is now set through the WheelController itself, instead of the WheelGroup tab.
Scene
- CharacterVehicleChanger was integrated into VehicleChanger. This will throw missing script warnings if the CharacterVehicleChanger was present in the scene/prefab.
- VehicleChanger no longer uses tags to auto-find vehicles. Use VehicleController > Settings > Register With Vehicle Changer option instead.
Multiplayer
- Changes to the multiplayer code to simplify implementing multiplayer.
v1.8.x to v1.9.x (v9.x)
- Clean import required.
v1.7.x to v1.8.x
- Clean import required.
v1.7.5 to v1.7.6
- Clean import required.
v1.7.3 to v1.7.4
- Clean import required due to asmdef changes.
- Lateral friction will be looser, meaning that increasing of the lateral friction coefficient of WheelController will be required to keep the same behaviour. However, the new calculation is more 'correct'.
v1.6.x to v1.7
- Due to changes to powertrain inertia the vehicles will now accelerate a bit faster for the same engine power.
- Mirror multiplayer vehicles can now use NetworkRigidbody instead of NetworkTransform for better multiplayer behavior and two-way collisions. Both scripts should not be present at the same time.
v1.5.x to v1.6.x
- <fc #ff0000>Clean import is required due to asset restructuring.
</fc>
Project Settings > Player > Api Combatibility Level
needs to be set to.NET 4.x
(requirement will be removed with v1.6.1).- Asset now uses assembly definition files. To access NVP2 scripts from other assemblies a reference to NVP2 will need to be added to the other assembly definition file. More about that here.
- If using multiple NWH assets simultaneous update is required. Delete all the NWH assets and do a clean import. This is required do to restructuring of Common folder to better accommodate .asmdefs.
- Removed torque converter option. Use clutch slip torque instead - this gives identical results to the previous torque converter option.
- CVT transmission now uses single forward and single reverse transmission gear ratio, both indicating minimum gear ratio for that direction. Other ratios will are ignored.
- SteeringWheelInput users will need to set up assembly definitions for Logitech SDK: http://nwhvehiclephysics.com/doku.php/NWH/VehiclePhysics2/Input/SteeringWheelInputProvider. Without this step SteeringWheelInputProvider will not be able to find LogitechGSDK class.
v1.5 to v1.5.1
- PIDController.cs might get duplicated on import. Remove NWH/VehiclePhysics2/Scripts/Vehicle/Utility/PIDController.cs if this happens.
v1.4 to v1.5
- Clean import is required due to folder restructure to allow all NWH assets to work side by side.
- WheelController damper settings will need to be somewhat reduced (~50%) due to changes to damper calculation.
- Input-related classes have been renamed to prevent issues when importing more than one NWH asset in the same project. Changes: Input > VehicleInputHandler, InputStates > VehicleInputStates.
v1.3 to v1.4
- VehicleController now requires NRigidbody to be attached. NRigidbody will be added to newly created vehicles automatically but for existing vehicles it is best to add it manually.
v1.2 to v1.3
- None. If upgrading from older versions check the notes below.
v1.1 to v1.2
- Delete Scripts folder before upgrading. Some scripts have changed namespace and Unity will import them twice if the old version is not deleted first.
- InputProviders have been split to SceneInputProvider and VehicleInputProvider where SceneInputProvider handles scene-related input (camera controls, vehicle switching, character movement, etc.) and VehicleInputProvider handles only vehicle-related input (steering, throttle, brakes, etc.). To upgrade besides VehicleInputProvider make sure to have SceneInputProvider present as well (
InputManagerSceneInputProvider
,InputSystemSceneInputProvider
orMobileSceneInputProvider
- depending on which input is used). - Some of the scripts have been moved to NWH/Common directory. These are the scripts that are shared between multiple NWH Coding assets (VehicleChanger, CameraChanger, RigidbodyFPSController, etc.).
v1.0 to v1.1
v1.1 was an input focused update and most of the actions needed to upgrade from v1.0 are input-related.
- It is recommended to delete Scripts > Vehicle > Input folder before upgrading. Some scripts and files have been renamed and might result in duplicate imports upon upgrade.
- v1.1 requires InputSystem package to be installed. This does not mean that it has to be used - just needs to be present in the project. InputSystem should get automatically installed when updating the asset. If this does not happen, install it through Package Manager.
- If using InputManager (old/classic Unity Input) some of the input mappings will need to be changed. List of new bindings is available here. Updated guide on setting up Input Manager can be found here.
Horizontal
axis was renamed toSteering
.Vertical
axis was split toThrottle
andBrakes
.CameraRotation
,CameraPanning
,CameraRotationModifier
,CameraPanningModifier
,CameraZoom
,FPSMovement
andToggleGUI
bindings need to be added for demo scene to function properly.
- Despite removing
Vertical
axis from the bindings it is still available under vehicleController.input.Vertical for easier integration with AI and similar systems.
NWH Vehicle Physics 1 to NWH Vehicle Physics 2
- Before upgrading to NWH Vehicle Physics 2 please remove any previous versions of NWH Vehicle Physics and Wheel Controller 3D from the project.
- NWH Vehicle Physics 2 is significantly different from NWH Vehicle Physics 1 and a manual upgrade of the existing vehicles is required.
- Check out Vehicle Setup Wizard script - it speeds things up a lot.