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 easy rebinding. ForceFeedback capabilites can be accessed via the DIManager class. The DirectInputExplorer is a windows forms application built in parallel with the C++ library to enable quick development by avoiding the need to reload Unity after every change. It also functions as an easy way to examine DirectInput devices.
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 | ✅ Verified |
PRO Racing Wheel | 🔲 Untested |
This plugin only works on Windows 64 bit.
Latest verified Unity version: 2022.2.1f1
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. See issue #1 for more info.
If you're having any problem, please raise an issue on GitHub.
This project is free Open-Source software, and is released under the LGPL-3.0 License, further information can be found under the terms specified in the license.