Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Concerning Vibration Output

Jibran Syed edited this page Aug 8, 2017 · 7 revisions

<- Back to the Wiki
<- Back to the What Works


In Summary:

XboxCtrlrInput does not support controller vibration output. For more details, read below.

Rationale

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.

Considerations for Windows

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.

Considerations for macOS and Linux

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.

Further References

  • 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 in FixedUpdate() instead.

<- Back to the Wiki
<- Back to the What Works

Clone this wiki locally