Unity Native Plugin to expose DirectX DirectInput ForceFeedback
This package allows you to easily integrate both the input and ForceFeedback features of DirectX DirectInput from within Unity. This allows you to interface with HID peripherals with ForceFeedback capabilities. This can be used to build vivid simulated experiences.
The package will create a virtual device inside Unity's Input System. This device can then be used like any other device inside the Input System, allowing for easiy rebinding. ForceFeedback capabilites can be acceced via the DIManager class.
This package requires use of Unity's new Input System, ensure com.unity.inputsystem is installed in the project. Install it via the package manager via:
Window -> Package Manager => Input System
Next, install this package:
Package Manager => + => "Add package from git URL..." => https://github.com/MrTimcakes/Unity-DirectInput.git
| Effect | Supported |
|---|---|
| ConstantForce | ✅ |
| CustomForce | 🔲 |
| Damper | ✅ |
| Friction | ✅ |
| Inertia | ✅ |
| RampForce | 🔲 |
| SawtoothDown | 🔲 |
| SawtoothUp | 🔲 |
| Sine | 🔲 |
| Spring | ✅ |
| Square | 🔲 |
| Triangle | 🔲 |
| Peripheral | Test Status |
|---|---|
| Fanatec CSL Elite | ✅ Verified |
| Fanatec CSW V2.0 | ✅ Verified |
| Fanatec WRC Wheel Rim | ✅ Verified |
| Fanatec Formula V2 Wheel Rim & APM | ✅ Verified |
| Fanatec CSL LC Pedals | ✅ Verified |
| Fanatec ClubSport Pedals V3 | ✅ Verified |
| Fanatec ClubSport Shifter SQ V 1.5 | ✅ Verified |
| Logitech G29 / G920 | 🔲 Untested |
This plugin only works on Windows 64 bit.
Unity Version: 2021.1.16f1
Occasionally calls to EnumerateDevices will take orders of magnitude longer than usual to execute (up to 60 seconds), this is caused by a Windows bug attempting to load an absent hardware device. USB Audio DACs & Corsair keyboards are known the cause this issue, try disconnecting and reconnecting offending USB devices. For more information see this StackOverflow post about the issue from 2012.
If you're having any problem, please raise an issue on GitHub.
This project is free Open-Source software, and is released under the GPL-3.0 License, further information can be found under the terms specified in the license.