Here is a small guide to fixing model rotation in Unity using Blender as this seems to be a common problem.
When setting up NWH Vehicle Physics 2 (or any other asset in Unity) it is important to use correct model rotation.
Unity assumes Z-axis points forward, X-axis to the right and Y-axis upwards.
Unity has an official guide on fixing model rotation here, but that is more of a fix for those that do not want to use 3D modelling software than a solution.
To fix model rotation we are going to use Blender, an open source 3D modelling software that is more or less a standard in the indie developer community. If you do not have it installed already, get it here.
To make sure the object has correct rotation switch to “Local” handle rotation. This will show the axes of currently active tool relative to the currently selected object and not the world axes as is the default setting.
Selected object should now look like this:
If the arrows are pointing in some other direction - model rotation is incorrect. If the arrows are not positioned at the center (or required) position then the Pivot is incorrect too. More about that in the next section.
Open Blender 2.8+ and import your model (File ⇒ Import ⇒ [YourFileFormat]). Upon import your model might look something like this:
It is a bit confusing at first because blender uses different coordinate system from Unity - namely Y-forward, X-right, Z-up.
To fix the rotation do the following:
Model should point towards -Y axis for it to properly export to Unity.
Pivot is the point around which the object rotation will happen. If your wheel pivot is incorrect it will rotate off-center.
To check for correct pivot set the tool handle position to “Pivot” (instead of default “Center”) and select your object. Wheel pivot should be in the exact center to the wheel, not offset in any direction.
Pivot in Blender is marked with small yellow dot:
To center the pivot select the object and press F3 and type “Set Origin” in the search box and then select Origin To Center Of Mass (Volume). The yellow dot should now be in center:
When pivots look like in the image above the pivots are properly set. Export the model to FBX using File ⇒ Export menu.