-
Notifications
You must be signed in to change notification settings - Fork 33
Concerning Vibration Output
<- Back to the Wiki
<- Back to the What Works
In Summary:
XboxCtrlrInput does not support controller vibration output. For more details, read below.
Because XboxCtrlrInput is targeted at Windows, macOS, and Linux, its goal is to have as many features in common as possible. In brief, controller vibration output (or just "vibration" for short) is only natively available on Windows, and only through the underlying XInput.NET API.
Because of this, XboxCtrlrInput doesn't support vibration on any platform. The only way for such support to exist is that someone has to make Xbox Controller vibration API for macOS and Linux, in C#, to be able to access such a feature. I don't work that deep into input APIs, and thus I can't do it.
Since XboxCtlrInput is open-source, developers could add vibration functionality for their own projects on Windows. This requires you to understand XCI's general implementation and understand that XInput.NET is used internally to access controller input (on Windows only). Specifically, you need to know about the GamePad
class (scroll all the way to the bottom) and the call the method SetVibration()
in your code.
Unfortunately, there is no way to access the vibrators on Xbox controllers, unless someone made a C# API to access controllers in a similar fashion to XInput.NET.
- Issue #14 was the first discussion concerning vibration support.
- Issue #23 discusses a possible implementation for vibration on Windows.
-
Issue #28 informs developers to never put vibration code in the regular Unity
Update()
call, but inFixedUpdate()
instead.