Unity Package for Buttplug support in Unity 2018.2+.
Buttplug Unity contains a Intiface CLI executable, so Intiface Desktop is not required. It is still recommended that you allow users to connect out to ID somehow, though.
Option #1: OpenUPM CLI
If you have the OpenUPM command line interface installed, then this is the fastest way to add the package to your project:
- Open your Unity project folder in a terminal like CMD or PowerShell
openupm add com.nonpolynomial.buttplug-unity
Option #2: Use OpenUPM's Installer Package
You can download and import the ButtplugUnity installer package which sets up the package reference and then removes itself.
- Download the Latest Buttplug Unity Installer Package
- In Unity, use
Assets > Import Package > Custom Package...
- Open the downloaded package.
Option #3: Edit Package Manager
You can also manually perform the setup steps in Unity 2019+.
- Go to
Edit > Project Settings > Package manager
- Click the
+button in the registry list
- Name it
- Set the URL to
- Set the Scope to
- Go to
Window > Package Manager
- Use the drop down in the upper left to select
- Select the
Options #4: Clone This Project
This is a fully functional Unity project that you can clone as your own. This will mean you have the Buttplug Unity package files locally, so you'll need to manually update the package or pull latest from this project as updates are made.
https://github.com/buttplugio/buttplug-unitywith your favorite Git client
- Open root of the cloned project folder in Unity 2019.
- Open the
Example/Example.unityscene file to run the example script.
Note that this repo is a complete Unity project that can be opened and run in Unity.
Using Buttplug consists of the following steps:
- Setting up a connector and client
- Connecting to a server
- Scanning for devices
- Controlling devices
For the first 3 of those steps, we provide helper methods in the ButtplugUnityHelper file. See the comments in that file and the examples for usage documentation.
In Buttplug C# (which Buttplug Unity is built on), most of these are async functions, as accessing both the network and the hardware are slow functions that can block. We highly recommend executing tasks on background thread pools, as not to interrupt game actions. More examples related to this will be released soon.
What hardware will this work with?
An up-to-date list is kept at IOSTIndex, using the Buttplug C# filter.
How does the Buttplug Unity package change my Unity project?
When the Buttplug Unity package is loaded, it checks to see whether a StreamingAssets directory already exists. If not, it creates the directory, and under that, creates a Buttplug directory, to which it copies the Intiface CLI executable. This allows us to make sure that Unity packages the executable with your game.
As of 1.0.0, in order to make usage as work-free as possible, this functionality is automatic and there is no way to turn it off. If this affects your project in adverse ways, or if you would like to have the option to only use Intiface Desktop versus handling the binary yourself, please file an issue (or if one is already filed, add a +1 comment), and we'll try to figure out another way to do this.
Why do I have to run an outside process alongside my game?
By hosting hardware access externally, we minimize the impact of errors and crashes on the game process. While we certainly do our best to avoid errors, dealing with hardware can sometimes be a dynamic and challenging situation, where an extended period of normal usage can be suddenly interrupted by shit going absolutely fucked. By keeping process separation as a boundary, we can assure games that as much of the fuckery as possible stays on the Buttplug side.
Does Buttplug Unity work with IL2CPP?
Can I use Buttplug Unity in my commercial game?
Yes, Buttplug Unity falls under the same BSD 3-Clause license as the rest of the library, meaning you just need a copyright acknowledgement in your game credits and license file. If you are interested in featuring our logos on your loading screen (which we appreciate!), please contact us on Discord or Twitter to discuss.
How can I get direct support from the Buttplug developers for my game?
I don't see my question here, what should I do?
- File an issue on this repo
- Join the Discord Server and ask there