Special Platform Support

Platforms:

 


Microsoft Windows 10 Universal

Windows 10 Universal support requires Unity 5.2+

See Known Issues for Windows 10 Universal

CRITICAL WARNING: Versions of Rewired prior to 1.1.38.4 no longer work on the UWP platform as of Unity 2020.2.0f1 due to a new bug in IL2CPP. Update to Rewired 1.1.38.4+ to build on this platform.

CRITICAL WARNING: There is a known issue with Unity on both .NET and IL2CPP builds in Unity 2018.2.0 - 2018.2.18 that causes the application to crash when a gamepad is disconnected. It is recommended you update to a version of Unity of 2018.2.19 or greater. See this form more information.

End-User Requirements:

Installation:

To build for the Windows 10 Universal platform, you must install Windows 10 Universal support. In order to build for this platform, you must be using the Windows Unity editor.

Install Windows 10 Universal platform support through the menu:
Window -> Rewired -> Setup -> Install Platform Support -> Windows 10 Universal

IMPORTANT NOTE:

The following applies ONLY if you have moved the Rewired folder from its default location. If you have not moved the Rewired folder, skip this section and do not make any changes to any DLLs.

Unity 5+ requires that a Placeholder path be set in the Rewired/Internal/Libraries/Runtime/UWP/Rewired_Core.dll and/or Rewired/Internal/Libraries/Runtime/UWP/IL2CPP/Rewired_Core.dll (depending on your scripting backend) inpspector or you will get compilation errors when you try to compile. If you move Rewired from its default install location, you must set this path to the current location of the main Rewired_Core.dll in your project. If you move the Rewired folder to another directory, this path will have to be changed manually because Unity stores a path here instead of a GUID. Do not make any changes to any DLL unless you have moved Rewired out of its default location.

Here are the steps:

  1. Rewired/Internal/Libraries/Runtime/UWP/Rewired_Core.dll and/or Rewired/Internal/Libraries/Runtime/UWP/IL2CPP/Rewired_Core.dll in the project view (select and change one at a time).
  2. In the inspector, click the Placeholder field and navigate to Assets/Rewired/Internal/Libraries/Runtime/Rewired_Core.dll.
  3. Click Apply.

This is not automated because users tend to move Rewired around into various folders in the project. Because Unity chose to store a path here instead of a GUID, the link will break each time the Rewired folder is moved.

Enabling HID Joystick Support

In Unity 5.6+, you can enable HID device support through the Unity Build Player settings:

Build Settings -> Player Settings -> Publishing Settings -> Capabilities -> HumanInterfaceDevice

HID

While this option was available in older versions of Unity, it did not enable both HID usages 4 and 5 causing some gamepads not to appear to the system.

For older versions of Unity, in order to enable support for HID joysticks, after building the project in Unity, open the new Windows 10 Universal project in Visual Studio and edit the Package.appxmanifest file with the XML text editor and add the following lines:

<Capabilities>
<DeviceCapability Name="humaninterfacedevice">
<Device Id="any">
<Function Type="usage:0001 0004" />
<Function Type="usage:0001 0005" />
</Device>
</DeviceCapability>
</Capabilities>

The <Capabilities> tag and its contents must be placed between the <Package> and </Package> tags. This gives the app permission to read HID joysticks and gamepads. If you do not add this or do not add it correctly, HID joysticks will not work. However, the XBox 360 Controller and other XInput-compatible controllers will still function.

WARNING: Unity 2018.2.0 - 2018.2.18: There is a known issue with Unity in IL2CPP builds when enabling support for HID joysticks. See this for more information.

Error On DLL Import

Unity reports this error every time the Rewired_Core.dll for Windows 10 Universal .NET is imported or reimported into the project:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

Ignore this error. There is no reason for this error and no way to silence it. It has no effect on the functionality of the library.

 


Microsoft Xbox One (XDK)

The following information applies only to XDK builds:

Rewired includes special support for XBox One for better controller support and more accurate hot-plugging behavior. Rewired supports gamepad vibration on XBox One, however you must first install the prerequisite Xbox One native library provided by Unity.

If you receive an error when switching to the Xbox One build target in Unity, make sure the Xbox One platform is checked on the Rewired_Core.dll import options.

Dependencies

Xbox One support requires that you install the following native library provided by Unity in the Plugins/XboxOne folder in your project:

  • Gamepad.dll

To get the library, go to:
Unity Xbox Forums > Unity for Xbox One Downloads (Sticky Topic) > Under the "Plugins" section

The file Gamepad.dll can be found in Binaries\Native\Variations\Durango_Release in the plugins package.

If this dependiency is not installed correctly, XBox One builds will not function. You will only see black screen when launching the build on the Xbox One if the library is not installed.

If Gamepad.dll throws exceptions or causes errors, you will need to rebuild it from source code. Unity provides the source code. They do not continually update the built DLL for every new version of the SDK, so it may not work without being rebuilt to the version of the SDK you are using.

Crashes on Start

This is always due to improper set up of the dependency noted above. If Gamepad.dll is not found, not in the proper location, or does not have the proper inspector settings to enable it to be included with the XBox One build, all p/invoke calls to Gamepad.dll will fail, which crashes the XBox One rather than throwing an exception which can be caught and handled as happens on all other platforms. If the version of Gamepad.dll you are using does not have the exact method signature Rewired expects, it will also crash. If you upgrade Unity versions but do not update the Gamepad.dll also, it may also crash if the gamepad.dll has been built to a different version of the Xbox One SDK.

If for any reason you cannot get the Gamepad.dll, you can disable all calls to the DLL by setting "Xbox One: Disable Vibration" in the Rewired Global Options window which can be found at: Window -> Rewired -> Global Options. This will disable support for gamepad vibration.

Accessing XBox One Controller Features

Special controller features of the XBox One gamepad such as vibration can be accessed via the XboxOneGamepadExtension class available in the Joystick class as seen in this example.

Troubleshooting

See Troubleshooting - Xbox One for solutions to issues on the Xbox One platform.

 


Microsoft Xbox Game Core

Rewired requires a separate plugin to support the Xbox Game Core platforms. This plugin is only available to licensed Xbox Game Core developers. Please fill out the Xbox Game Core Plugin request form requesting access to the Game Core plugin providing your email address and contact information (including company) that is reigstered with Microsoft and is authorized for Xbox Game Core development. Please be patient as the information has to be validated with Microsoft. You will receive download instructions when the information has been validated.

Be sure to check your email spam folder for the download instructions email.

 


PlayStation®4

Rewired requires a separate plugin to support the PlayStation®4 platform. This plugin is only available to licensed PlayStation 4 developers. You can register for the Rewired plugin on PS4 DevNet under the Tools & Middleware section. You will receive an email with download instructions when your registration has been processed.

Be sure to check your email spam folder for the download instructions email. If you have not received download instructions 24 hours after registering, contact support.

 


PlayStation®5

Rewired requires a separate plugin to support the PlayStation®5 platform. This plugin is only available to licensed PlayStation 5 developers. You can register for the Rewired plugin on PS5 DevNet under the Tools & Middleware section. You will receive an email with download instructions when your registration has been processed.

Be sure to check your email spam folder for the download instructions email. If you have not received download instructions 24 hours after registering, contact support.

 


Nintendo Switch

Rewired requires a separate plugin to support the Nintendo Switch platform. This plugin is only available to licensed Nintendo developers. More information can be found on the Nintendo Developer Portal.

Fill out the form on the Nintendo Developer Portal for the Rewired Nintendo Switch Plugin and wait until you receive a response by email with instructions on how to download it. You will receive an email with download instructions when your registration has been processed.

Be sure to check your email spam folder for the download instructions email. If you have not received download instructions 24 hours after registering, contact support.

 


Google Stadia

Rewired requires a separate plugin to support the Stadia platform. This plugin is only available to licensed Stadia developers. Please contact your Stadia developer account manager for details on how to register for the plugin.

Be sure to check your email spam folder for the download instructions email.

 


Steam

See Best Practices - Steam and the Troubleshooting - Steam documentation for more information.