User Tools


Steering Wheel Input Provider

SteeringWheelInputProvider inspector.

SteeringWheelInputProvider adds steering wheel (Logitech/Thrustmaster/etc.) support to NWH Vehicle Physics 2.
Besides retrieving input from the wheel it also manages force feedback (FFB).
Logitech SDK is required for SteeringWheelInputProvider to work - check setup steps below. Despite the name, Logitech SDK also works with wheels from other manufacturers since it uses DirectInput as the backend.

This script requires two front wheels to function

Setup

Logitech SDK
  • Download Logitech SDK asset from Unity Asset Store (link). Logitech SDK is known to ship with problematic LogitechSteeringWheelEnginesWrapper.dll file. To fix this:
    • Download Steering Wheel SDK from Logitech Website (link).
    • Find correct LogitechSteeringWheelEnginesWrapper.dll inside the downloaded SDK and replace the one in the Unity project with it.
    • Restart Unity (important, Unity does not unload native dll files until restarted so the old dll will still be in memory).
    • Attach LogitechSteeringWheel from Logitech SDK ⇒ Script Sample to any object in the scene and press play. Make sure that there are no errors and that the axes and inputs are recognized in the GUI.
    • Once done, remove LogitechSteeringWheel. This script will not be needed any more (except for any future debugging if needed).
Input Provider
  • Import NWH Vehicle Physics 2 > Scripts > Vehicle > Control > Input > InputProviders > SteeringWheelInput > SteeringWheelInput.unityasset by double clicking on it in the inspector.
  • Attach the SteeringWheelInputProvider to any object in the scene. Make sure that there is only one InputProvider of type SteeringWheelInputProvider present in the scene.
  • Adjust Vehicle Source as needed.
  • Press play. Once a vehicle is entered force feedback will start working.
  • To adjust per-vehicle settings, attach ForceFeedbackSettings script to that vehicle.