| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
! Please bind your DirectInput device keys by pressing the F2 button, or by clicking the Quick Setup button (the top-left side of the screen) after playing the demo.
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 capabilities 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.
Prerequisite: This package requires the use of Unity's new Input System to ensure com.unity.inputsystem is installed in the project. Install it via the package manager: Window -> Package Manager => Input System, recommended only to activate and use this Input System.
Step-by-step UPM installation:
https://github.com/imDanoush/Unity-DirectInput.git
Benefits of UPM Git installation:
If you prefer manual installation or don't have Git installed:
Regardless of installation method, restart Unity to ensure proper DLL loading and access to the new runtime UI features.
Note: Folders ending with ~ are excluded by Unity during import and contain the Windows ForceFeedback Explorer application located at ./DirectInputExplorer~\DirectInputExplorer\bin\ for advanced device testing and configuration.
| Effect | Stat |
|---|---|
| ConstantForce | ✅ |
| Damper | ✅ |
| Friction | ✅ |
| Inertia | ✅ |
| RampForce | ✅ |
| SawtoothDown | ✅ |
| SawtoothUp | ✅ |
| Sine | ✅ |
| Spring | ✅ |
| Square | ✅ |
| Triangle | ✅ |
| CustomForce | ℹ️ |
| Front Collision | ✅ |
| Rear Collision | ✅ |
| Left Collision | ✅ |
| RightCollision | ✅ |
Note that everything is adjustable in the native DLL. The Custom Force effect exists but has not been fully implemented, and the collision effects are only in the Unity project. This is optimized to be used in the Unity Game Engine only.
The community has tested and verified that these devices do indeed work. Although not all devices support all the FFB effects!
| Peripheral | Test Status |
|---|---|
| Simucube Ultimate 2 | ✅ Verified |
| Fanatec DD1 | ✅ Verified |
| Fanatec CSL DD (Both PC & Comp mode + 8NM Kit) | ✅ Verified |
| 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 V1 | ✅ Verified |
| Fanatec ClubSport Pedals V3 | ✅ Verified |
| Fanatec ClubSport Shifter SQ V 1.5 | ✅ Verified |
| Logitech G29 / G920 | ✅ Verified |
| PRO Racing Wheel | ✅ Verified |
| Simagic Alpha-Mini | ✅ Verified |
| Moza R16 | ✅ Verified |
| Moza R12 | ✅ Verified |
| Moza R9 | ✅ Verified |
| Moza R5 | ✅ Verified |
| Moza R3 | ✅ Verified |
| Thrustmaster TX | ✅ Verified |
Note for pedals: exclusively input readings would work; FFB pedals and haptic devices are completely different!
The DirectInputManager should run on Windows 10 22H2 and newer (e.g., Windows 11) out of the box. The DirectInput API is available on these modern Windows versions without additional packages.
For developers working on the project:
For end users running the built application:
For Unitypackage, if you do not have some SDKs installed, you may get an error stating that the DLL is not found. To solve that issue, do the following:
- Clone the DirectInput repository,
- Then go to the /DirectInputForcefeedback~ folder, where there is a .sln Visual Studio project file,
- Open it and press F5 in VS to build a new DLL, where you'll be asked to install the missing SDKs
- The newly built DLL will be available in the directory specified by the output setting in Visual Studio; then copy it from where it was created, and paste it over the DLL in Unity's Asset/Plugin folder for Direct Input. However, this step should be done by Visual Studio after a build by itself.
Important Note: This plugin was designed primarily for standard DirectInput wheelbases. Thus, it aims to support force feedback on the first/primary axis of FFB-capable devices.
While the code enumerates all available FFB axes and includes them in effect definitions, the current API functions do not provide individual control over secondary axes.
To properly support multiple FFB axes, the API would need to be extended with functions that:
These enhancements would enable support for devices with multiple force feedback axes, such as dual-motor joysticks or specialty controllers.
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 to cause this issue. Try disconnecting and reconnecting the offending USB devices. For more information, see this StackOverflow post about the issue from 2012. See issue #1 for more info.
The original fundamentals coded by Mr.TimCakes, though, got significantly changed.
This project is free Open-Source software released under the LGPL-3.0 License. Further information can be found under the terms specified in the license.
| Back | FazBrowse Home | New Git URL |