Skip to content

MatheusPereiraBarros/Unity-DirectInput

 
 

Repository files navigation

Unity DirectInput Force Feedback

Unity Native Plugin to expose DirectX DirectInput ForceFeedback

Made with Unity GitHub issues GitHub package.json version GitHub

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.

Quick Start

Installation

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

Supported ForceFeedback Effects

Effect Supported
ConstantForce
CustomForce 🔲
Damper
Friction
Inertia
RampForce 🔲
SawtoothDown 🔲
SawtoothUp 🔲
Sine 🔲
Spring
Square 🔲
Triangle 🔲

Compatible Devices

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

Environment

This plugin only works on Windows 64 bit.

Unity Version: 2021.1.16f1

Notice

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.

Support

If you're having any problem, please raise an issue on GitHub.

License

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.

About

Unity Native Plugin to expose DirectX DirectInput ForceFeedback

Resources

License

GPL-3.0, Unknown licenses found

Licenses found

GPL-3.0
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C# 69.4%
  • C++ 30.2%
  • C 0.4%