Known Issues

Topics:

General

Windows:

OSX:

Linux:

Unity Editor (all platforms):

Android:

iOS / tvOS:

Xbox One:

Ouya:

SDL2:

Steam:


 

General:

 

Running in a Sandbox

Windows (tested with Sandboxie):

  • Due to a lack of permissions, Rewired is unable to receive device information from Raw Input when run inside a sandbox. Joysticks will not work properly in Raw Input mode. (As a note, Unity itself is also unable to receive this information, rendering joystick support in Unity broken under the default security settings.)
  • Direct Input mode is able to receive joystick input, but joystick plug/unplug notifications are blocked, so hot-plugging does not work properly even in Direct Input mode.

 


 

Windows

 

Windows Standalone, IL2CPP: Rewired falls back to Unity input

IL2CPP building is a brand new feature added in Unity 2018.

Rewired is not compatible with the IL2CPP scripting backend on desktop Standalone platforms at this time. If you build to IL2CPP on a Standalone platform, Rewired will fall back to non-native Unity input mode and many features such as support for 20+ buttons per-controller, controller vibration, universal XInput device compatibility (Windows), gyro/accelerometer support certain devices, much more robust device detection and support, and more will be unavailable.

Support for IL2CPP on Standalone platforms is being worked on, but there is currently no ETA due to technical issues. This documentation will be updated when support is added.

 


Windows Standalone, Direct Input: Joysticks not detected when using .Net 4.6 scripting backend

As of Unity 2018.2.18, when using the .Net 4.6 scripting backend joysticks are not detected when using Direct Input as the primary Input source due to a critical low-level IL instruction used by Rewired's C# Direct Input library. Support for this instruction is required for the C# library to function. There is no workaround short of removing the C# library and rewriting it in C++ and compiling a native DLL. This has been reported to Unity.

The only workaround is to switch to using the Raw Input as the primary input source, which is superior to Direct Input in almost all ways anyway.

 


Windows Editor: Crash in Unity 5.6+ with Oculus Touch

There have been multiple reports of crashes in Unity 5.6+ on Windows when using Unity input as the input source with Oculus Touch controllers attached. This crash is not due to Rewired but is a Unity issue. It can be reproduced without Rewired involved by calling GetAxis and GetButton on the Oculus Touch controllers through UnityEngine.Input. It seems to occur most frequently immediately when pressing Play in the editor. It may be related to calling UnityEngine.Input on the Oculus Touch devices in Awake or on the first Update frame. It can reportedly be avoided by disabling the Rewired Input Manager in the inspector, then enabling it after Play mode has been entered. The effect this has is to defer making calls to UnityEngine.Input until after the first frame or two of Play mode.


Windows Platforms: XInput devices on Windows appear as "XInput Gamepad"

On Windows, with Use XInput enabled, and always on Windows App Store and Windows 10 Universal builds, there's no way to differentiate one XInput controller type from another. To XInput, everything is simply Gamepad with an id of 0-3. This is not a Rewired issue, it is a design decision by Microsoft.

There is no possible way to associate an XInput id to the matching HID device to get its name and make it be recognized as a specific controller. Because of this, you cannot identify an XInput controller by name in Windows when XInput is enabled. This also affects which controller maps are loaded for this joystick in Windows when using XInput. Since the device is simply an Xinput device, it will be loaded from the XBox 360 controller definition, not the Logitech F310, for example. (However, if you create your controller maps using the Gamepad Template, you don't even need to worry about this.)

The only way you will be able to identify these controllers by name is to disable Use XInput in the Rewired Input Manager (applies to Windows Standalone only, not Windows App Store or Windows 10 Universal -- XInput cannot be disabled on these platforms). Once you do that, you introduce new issues/limitations:

  1. L/R triggers are treated as 1 combined axis and both cannot be pressed simultaneously without canceling each other out.
  2. You lose universal XInput controller support because each XInput controller now must be specifically recognized and mapped. Any unrecognized XInput devices will be treated as Unknown Controllers.
  3. Vibration is not supported without XInput enabled.
  4. The Steam Controller as well as Steam Streaming and Steam Link can no longer be supported if using Raw Input.
  5.  


Windows Platforms: All XInput devices use the Xbox 360 Controller map when "Use XInput" is enabled

As explained in the previous topic, when Use XInput is enabled and always on Windows App Store and Windows 10 Universal builds, there is no way to differentiate one XInput device from another by name or product/vendor id. Therefore, all XInput devices will use the Xbox 360 Controller map on Windows when Use XInput is enabled. This will match all XInput devices, generic or not, and will provide full coverage of all XInput devices. You cannot map these devices based on the individual device type such as Xbox One or Logitech F310 when using XInput because the device cannot be identified as as specific device type but rather simply as an XInput gamepad. All XInput gamepads will use Xbox 360 Controller profile when Use XInput is enabled.

If you disable Use XInput, you will get device-specific identification and recognition (Windows Standalone only, not Windows App Store or Windows 10 Universal), but you will also have the drawbacks explained in the previous topic.

There is rarely ever a need to map these controllers individually by using the specific device-type maps. Just create your Joystick Map using the Gamepad Template and it will cover all gamepads listed here regardless of whether or not you have Use XInput enabled.

 


More than 4 XBox controllers cannot be used at the same time

Windows Standalone
XInput has a hard limit of 4 devices. This is not a Rewired limitation, it is a limitation in Microsoft's XInput system.

You can mix and match non-XInput devices with XInput devices for a total of more than 4, but you cannot use more than 4 XInput compatible devices simultaneously if XInput is enabled. If you need to support more than 4 XInput controllers, you must disable XInput in the Rewired Editor - Settings page.

Be advised that by disabling "Use XInput" in the Rewired Input Manager, you introduce these new issues/limitations:

  1. L/R triggers are treated as 1 combined axis and both cannot be pressed simultaneously without canceling each other out.
  2. You lose universal XInput controller support because each XInput controller now must be specifically recognized and mapped. Any unrecognized XInput devices will be treated as Unknown Controllers.
  3. Vibration is not supported without XInput enabled.
  4. The Steam Controller as well as Steam Streaming and Steam Link can no longer be supported if using Raw Input.

OSX Standalone
XBox 360 controllers on OSX require this XBox 360 driver. This driver also imposes the 4-device limit just like XInput. It is currently not possible to use more than 4 XInput devices simultaneously on OSX. Again, you can mix and match non-XInput controllers to achieve a total count greater than 4. Because the driver is required for the controller to be detected, there is no way to disable the use of this driver and get around this issue.

 


Windows Standalone (Use XInput enabled, Windows 10 Insider Preview): Game crashes when using or plugging in an XInput-compatible controller.

There have been reports of crashes when using XInput on one or more versions of Windows 10 Insider Preview. The crash can occur either on the start of the application (if an XInput-compatible device is attached) or when any XInput-compatible device is first attached. This issue is not an issue with Rewired but an issue with Windows 10 Insider Preview. I have been unable to reproduce any issue in Windows 10 Insider Preview.

The only possible workaround is to disable Use XInput in the Rewired Input Manager -> Settings -> Windows tab.

Rewired is 100% compliant with Microsoft's published guidelines for using XInput. Rewired works with all versions of XInput from Windows XP - Windows 10 without issue. If you or your customers experience this crash in Windows 10 Insider Preview, please report this error to Microsoft so they can fix it before rolling out the public release.

 


Windows Standalone (Unity Fallback, Windows 10): Xbox One Controller L/R and D-Pad mapping problems

Due to Microsoft driver issues, on versions of Windows 10 before the Windows 10 Anniversary Update, the L/R triggers and D-Pad on the Xbox One Controller may be mapped incorrectly and non-functional when using Unity Fallback input. Microsoft made Xbox One Controller driver changes in an early version of Windows 10 that caused the controller mappings to change when retrieving values through the HID driver. This change did not affect XInput. Unity uses a combination of direct HID device access and XInput to get input from XInput compatible devices. This caused the standardized mappings in Unity's input system to break, cross-mapping the D-Pad and the triggers. Microsoft acknowledged this as a mistake and finally rolled back this driver change in the Windows 10 Anniversary Update rolled out on August 2, 2016. After this update, the mappings reverted to the normal mappings consistent with Windows 7. Only users using Windows 10 pre-Anniversary update are affected. This does not affect Rewired if using the native input options instead of Unity fallback input.

 


Windows Standalone (Raw Input, Windows 10): XBox One controller causes system crash when removed when using Raw Input on Windows 10

Update: This has been fixed as of Windows 10 Anniversary Update.

This is not a bug or issue with Rewired. A recent Windows Update has introduced a new bug in Windows 10 when using the XBox One controller. When Raw Input is enabled, if the XBox One controller is disconnected at runtime, it will cause the entire system to become unresponsive requiring a hard reboot to fix. I have isolated this issue to a specific Windows API Raw Input function call which is not optional. There is no known workaround for this problem when using Raw Input. This bug has been reported to Microsoft.

The only possible workaround is to enable Use XInput so the XBox One Controller is handled by XInput instead of Raw Input.

 


Windows Standalone (Direct Input, Windows 10): Using two or more XBox One controllers will cause Unity to hang when using Direct Input on Windows 10

This is not a bug or issue with Rewired. A recent Windows Update has introduced a new bug in Windows 10 when using multiple XBox One controllers. When Direct Input is enabled, if two or more XBox One controller are attached, it will cause Unity to hang until all but one controller are removed. I have isolated this issue to a specific Windows API Direct Input function call which is not optional. There is no known workaround for this problem when using Direct Input.

The only possible workaround is to enable Use XInput so the XBox One Controller is handled by XInput instead of Direct Input.

 


Windows Standalone (Windows 10): Xbox One Controller stops working after another controller is unplugged

Applies to Windows 10 after Anniversary Update.

One or more Xbox One Controllers can stop working after unplugging any other Xbox One Controller. This is an Xbox One Controller driver bug introduced in the Windows Anniversary Update. There is no possible workaround to this issue. If this issue affects your game, please report it to Microsoft. This is not an issue with Rewired.

 


Windows Standalone (Windows 10): Game Center popup keeps appearing when pressing keyboard keys

Applies to Windows 10 after Anniversary Update.

When using Xbox One Controllers, At random, the Game Center popup may begin to appear every time a keyboard key is pressed or when clicking to different windows. This is an Xbox One Controller driver bug introduced in the Windows Anniversary Update. There is no possible workaround to this issue. If this issue affects your game, please report it to Microsoft. This is not an issue with Rewired.

 


Windows Standalone (Unity Fallback, Windows 10): XBox One controller has incorrect mapping

Microsoft changed the XBox One driver in Windows 10 and changed the mappings compared to Windows 7 and prior versions, then after the Windows 10 Anniversary Update, they reverted this driver change. When using Unity fallback as the input source, it is impossible to differentiate the XBox One controller on Windows 10 pre and post Anniversary Update. Therefore, the decision was made to support only the newest mapping. Xbox One Controllers will have incorrect mappings on Windows 10 prior to the Anniversary Update.

This is not an issue when using Raw Input, Direct Input, or XInput. It is advised that you do not use UnityEngine fallback input as the input source on the Windows Standalone platform due to this and many, many other issues.

 


Windows Standalone: Nvidia Shield Controller problems on Raw Input and Direct Input

With newer firmware versions, the Nvidia Shield Controller has major problems on Raw Input and Direct Input which cause massive slowdowns making the controller essentially unusable. The only way to support the controller on Windows is to enable Use XInput which is not subject to the same issues. The Nvidia Shield Controller can no longer be safely used on Windows Standalone without Use XInput enabled until Nvidia fixes the firmware problems. If the controller is used without Use XInput enabled, the frame rate will drop to an extremely low level. There is no possible workaround to this issue.

 


Windows Standalone, .NET 4.6 experiemental backend: Application freezes on exit in Unity 2017

Update: This Unity bug was fixed at some point in the Unity 2017 branch and does not appear in Unity 2017.4.14f1. The exact version where they fixed the bug is not known. It does not appear in Unity 2018.1.0f3 or later.

Solution: Update to the Unity 2017.4.14f1+.

As of Unity 2017.2.0f3, when the .NET 4.6 experimental backend is enabled in Windows, the application will freeze forever on exit (closing via the X window button or Alt + F4). The error occurrs outside Rewired's code after it has already shut down. Unity has confirmed this bug in the .NET 4.6 backend but no ETA for a fix is known.

Q: But it used to work before updating Rewired to 1.1.3.0+:

It actually did have the same issue, but you just couldn’t see it because Rewired was never actually running in native mode when the 4.6 backend was enabled in versions prior to 1.1.3.0 because of an unrelated exception
that made it fall back to Unity input silently. This exception was due to an unrelated issue involving reflection when using the .NET 4.6 backend. The exception was silently swallowed forcing Rewired to run in UnityEngine.Input mode instead. In 1.1.3.0, the silent exception was fixed allowing native input to actually be initialized revealing the new .NET 4.6 bug. Native input never worked when using the 4.6 .NET backend. The fact that older versions looked like they worked was just a fluke due to the unrelated exception preventing native input from being initialized.

Beta versions and experimental features of Unity are not supported by Rewired.

 


Windows Standalone, .NET 4.6 experimental backend: Editor corruption in Unity 2017.1

Update: Unity fixed the bug in Unity 2017.1.p4.

Solution: Update to Unity 2017.1.p4+.

The .NET 4.6 experimental backend contains a major bug that affects Rewired's ability to run in the editor. The 2nd time you press Play in the editor, it will throw thousands of exceptions and cause the editor to become corrupt until quit and restart. This bug has been reported to Unity.

More information about this bug can be found here:

The only workaround is to disable native input by setting the Primary Input Source for the editor platform you are using to Unity in the Rewired Input Manager -> Settings page. By doing this, you will lose access to all the special features and benefits native input provides.

Q: But it used to work before updating Rewired to 1.1.3.0+:

It actually did have the same issue, but you just couldn’t see it because Rewired was never actually running in native mode when the 4.6 backend was enabled in versions prior to 1.1.3.0 because of an unrelated exception
that made it fall back to Unity input silently. This exception was due to an unrelated issue involving reflection when using the .NET 4.6 backend. The exception was silently swallowed forcing Rewired to run in UnityEngine.Input mode instead. In 1.1.3.0, the silent exception was fixed allowing native input to actually be initialized revealing the new .NET 4.6 bug. Native input never worked when using the 4.6 .NET backend. The fact that older versions looked like they worked was just a fluke due to the unrelated exception preventing native input from being initialized.

Beta versions and experimental features of Unity are not supported by Rewired.

 


Windows 10 Universal: Certain gamepads appear twice when HID device support is enabled

Microsoft has apparently started mapping non-Xbox gamepads like the Sony DualShock 4 to make them appear as XInput devices through their UWP Windows.Gaming.Input system. This has the side effect that, if you enable the application to allow the use of HID input devices in the Package.appxmanifest, the DualShock 4 will show up as 2 devices at the same time -- an XInput gamepad and the HID DualShock 4 gamepad. While true XInput gamepads provide a way to identify them as such through the HID system, Microsoft has provided no way to determine that these pseudo-XInput devices (HID devices are being treated as XInput devices) are being handled by XInput, so there is no way to programatically filter out these duplicate devices. The only workaround is to disable HID device support. You can either do this by removing HID support from the package manifest in the Visual Studio build project or by disabling the "Support HID Devices" option in the Rewired Input Manager -> Settings -> Windows UWP page. This allows you to choose to support the Gamepad (XInput) system and/or the HID system for input devices. This is still not ideal, but it at least gives you the option to disable XInput to allow for wider device support without risking duplicate devices, though disabling XInput will also disable support for controller vibration. There is no perfect solution because Microsoft simply has not provided the ability to get the necessary information to allow devices to be filtered properly.

 


Windows 10 Universal IL2CPP: Crash when disconnecting controllers

There are three different disconnect crash scenarios, each with its own circumstances:

Scenario 1: XInput controllers on Unity 2018.2.0 - 2018.2.18

Severity: Critical

This issue was fixed by Unity in version 2018.2.19. Update to Unity 2018.2.19+.

Starting with Unity 2018.2.0, XInput-compatible controllers will crash the application when unplugged if the application is started with any XInput-compatible controller connected. This is a bug in Unity, not Rewired, and there is no possible workaround.

This bug occurs when any script or library makes a call to any part of the Windows.Gaming.Input.Gamepad API. Simply making this call will result in Unity crashing internally the next time a controller is unplugged. Use of Windows.Gaming.Input.Gamepad is absolutely required in order to get input natively from gamepads in Windows UWP.

You can easily reproduce this by creating a new Unity project and adding this script to a GameObject:

using UnityEngine;

public class GamepadTest : MonoBehaviour {
#if ENABLE_WINMD_SUPPORT
    void OnGUI() {
        GUILayout.Label("Gamepad Count: " + Windows.Gaming.Input.Gamepad.Gamepads.Count);
    }
#endif
}

Build the application and launch it with a gamepad connected. Unplug it and the application will crash with the following stack trace:

UnityPlayer.dll!dynamic_array<class GameControllers::Gamepads::XboxGamepad,0>::erase(class GameControllers::Gamepads::XboxGamepad *,class GameControllers::Gamepads::XboxGamepad *)
UnityPlayer.dll!GameControllers::Gamepads::XboxGamepads::UpdateCurrentGamepadList(void)
UnityPlayer.dll!GameControllers::Gamepads::XboxGamepads::GetCurrentGamepads(void)
UnityPlayer.dll!GameControllers::Gamepads::ProcessGamepadInput(class InputManager &,class std::map<unsigned int,int,struct std::less<unsigned int>,class std::allocator<struct std::pair<unsigned int const ,int> > > &,struct dynamic_array<unsigned int,0> &)
UnityPlayer.dll!Input::PreProcess(class Vector2f const &)
UnityPlayer.dll!UnityPlayer::AppCallbacks::DoPerformUpdateAndRender(void)
UnityPlayer.dll!UnityPlayer::AppCallbacks::PerformUpdateAndRender(void)
UnityPlayer.dll!UnityPlayer::AppCallbacks::_AppThreadImplementation(void *)
UnityPlayer.dll!UnityPlayer::AppCallbacks::_AppThread(void *)
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()

This affects the .NET scripting backend and the IL2CPP scripting backend.

Solution: Update to Unity 2018.2.19+.

Scenario 2: Non-XInput controllers

As of Unity 5.3.4f1, after enabling support for standard HID joysticks in the Package.appxmanifest, Unity may crash when disconnecting a non-XInput controller (also happens with XInput controllers in Untiy 2017). This is a bug in Unity, not Rewired and there is no possible workaround if you want to support any controllers besides XInput controllers. (To disable support for non-XInput controllers, remove the tags added to the Package.appxmanifest mentioned here.) This bug has been reported to Unity, but so far no fix has been announced.

This issue does not affect Windows 10 Universal builds when using the .NET scripting backend.

Update: This bug has been fixed as of Unity 5.3.5p1.
Update 2: This bug has resurfaced in Unity 2017.1.

Scenario 3: Xbox One S controller

As of Unity 2017.1, after enabling support for standard HID joysticks in the Package.appxmanifest and disabling Use XInput in the Rewired Editor -> Settings for Windows 10 UWP, the application will always crash when disconnecting an Xbox One S controller. This issue comes from the Windows HID API used to get HID device events. When Use XInput is enabled, the Xbox One S controller will be handled through the Windows.Gaming.Input API instead and no longer cause the crash.

 


Windows 10 Universal: Left Shift is activated when Right Shift is pressed

The left and right Shift keys cannot be differentiated on Windows UWP due to a bug/oversight in the Windows UWP API. Windows does not send key up events for the opposing Shift key when released while holding down the other Shift key. This makes it impossible to support both Shift keys as individual keys. Because of this issue, the two Shift keys can only reliably be treated as a single key. When either Shift key is pressed, only Left Shift will will return true. Right Shift will never return true. This is an issue with the underlying Windows UWP API and not a Rewired bug. There is no possible workaround.

 


Windows 10 Universal .NET: UnityException: Failed to run reference rewriter error on Unity 5.5.0, 5.5.1

You may receve an error similar to below when building to Windows 10 Universal on .NET on Unity 5.5.0 and 5.5.1:

UnityException: Failed to run reference rewriter with command --target="Temp\StagingArea\Rewired_Core.dll" --additionalreferences="Temp\StagingArea","C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Facade","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Calls.CallsVoipContract\1.0.0.0","C:\Program Files (x86)\Windows 

...

Catastrophic failure while running rrw: Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Windows.Foundation.UniversalApiContract, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

This error occurs when you have the Windows 10 "Creator's Update" SDK installed (10.0.15063.0) or later, but do not also have older versions of the SDK also installed. This is presumably due Unity not searching the correct location for the SDK libraries in this version of the Windows 10 SDK. The issue was fixed in 5.5.1. There are two possible solutions to this issue. Do one of the following:

  1. Install Unity 5.5.2 or later.
  2. Install an older version of the Windows 10 SDK also.

 


Windows Editor: <RI.Hid> Failed to create device file: 2 The system cannot find the file specified.

You may see the following error when starting the Unity Editor:

  • <RI.Hid> Failed to create device file: 2 The system cannot find the file specified.

This error is logged by Unity itself and is not created by Rewired, nor is it related to Rewired in any way. It cannot be silenced or fixed. There is a forum thread detailing the issue here.

 


Windows Standalone: Keyboard and mouse keys get stuck on when holding a key, right-clicking on the window's title bar, and then releasing the key

This bug affects the Unity Editor and builds running in windowed mode on Windows, OSX, and (possibly) Linux.

This is due to a bug in UnityEngine.Input which is used as the source of keyboard input on most platforms at the present time. Mouse buttons will also get stuck on in this same scenario of UnityEngine.Input is being used as the mouse input source (OSX, Linux, or if Native Mouse Handling is disabled on Windows.)

On Windows, enabling Native Keyboard Handling will eliminate this issue. Unfortunately, for other platforms, there is no workaround possible for this issue at this time. The bug has been reported to Unity.

 


Windows App Store support not working in Unity 5.0.0, fixed in 5.0.1

Due to a new bug introduced in Unity 5.0.0, Rewired is unable to be compiled in this version of Unity. The bug was fixed in Unity 5.0.1, so upgrade to 5.0.1 if you need Windows App Store support.

 


 

OSX:

 

OSX, IL2CPP: Rewired falls back to Unity input

IL2CPP building is a brand new feature added in Unity 2018.

Rewired is not compatible with the IL2CPP scripting backend on desktop Standalone platforms at this time. If you build to IL2CPP on a Standalone platform, Rewired will fall back to non-native Unity input mode and many features such as support for 20+ buttons per-controller, controller vibration, universal XInput device compatibility (Windows), gyro/accelerometer support certain devices, much more robust device detection and support, and more will be unavailable.

Support for IL2CPP on Standalone platforms is being worked on, but there is currently no ETA due to technical issues. This documentation will be updated when support is added.

 


OSX, .NET 4.6 experimental backend: Throws exception on initialization in Unity 2017.1 - 2017.3

Update: The Unity bug was fixed in Unity 2017.4.1f1. Any version of Unity after that should work correctly.

Solution: Update to Unity 2017.4.1f1+.

As of Unity 2017.2.0f3, when the .NET 4.6 experimental backend is enabled in OSX, an exception will be thrown on initialization causing Rewired to not function. This exception is due to a bug in the .NET 4.6 experimental backend that prevents all P/Invoke calls from functioning, always throwing a DllNotFoundException. The exact same call works using the .NET 3.5 backend while the 4.6 backend fails. This bug has been reported to Unity.

Due to the severity of this bug, until Unity fixes it, it is impossible for Rewired to use native input on OSX with the .NET 4.6 backend enabled. The only workaround is to disable native input by setting the Primary Input Source for the platform to Unity in the Rewired Input Manager -> Settings -> OSX page. By doing this, you will lose access to all the special features and benefits native input provides.

Q: But it used to work before updating Rewired to 1.1.3.0+:

It actually did have the same issue, but you just couldn’t see it because Rewired was never actually running in native mode when the 4.6 backend was enabled in versions prior to 1.1.3.0 because of an unrelated exception
that made it fall back to Unity input silently. This exception was due to an unrelated issue involving reflection when using the .NET 4.6 backend. The exception was silently swallowed forcing Rewired to run in UnityEngine.Input mode instead. In 1.1.3.0, the silent exception was fixed allowing native input to actually be initialized revealing the new .NET 4.6 bug. Native input never worked when using the 4.6 .NET backend. The fact that older versions looked like they worked was just a fluke due to the unrelated exception preventing native input from being initialized.

Beta versions and experimental features of Unity are not supported by Rewired.

 


 

Linux:

 

Linux, IL2CPP: Rewired falls back to Unity input

IL2CPP building is a brand new feature added in Unity 2018.

Rewired is not compatible with the IL2CPP scripting backend on desktop Standalone platforms at this time. If you build to IL2CPP on a Standalone platform, Rewired will fall back to non-native Unity input mode and many features such as support for 20+ buttons per-controller, controller vibration, universal XInput device compatibility (Windows), gyro/accelerometer support certain devices, much more robust device detection and support, and more will be unavailable.

Support for IL2CPP on Standalone platforms is being worked on, but there is currently no ETA due to technical issues. This documentation will be updated when support is added.

 


Keyboard keys stuck on Linux in Unity 5.1.1

Rewired uses UnityEngine.Input.GetKey to get keyboard input on Linux. Underlying issues in UnityEngine.Input's keyboard handling are inherited by Rewired.

This is not a Rewired issue, it's a Unity bug:
http://forum.unity3d.com/threads/unity-5-1-1-broke-input-for-linux-standalone.335113/

Update to Unity 5.1.2 to fix it.


Keyboard keys repeat when held on Linux in builds

Rewired uses UnityEngine.Input.GetKey to get keyboard input on Linux. Underlying issues in UnityEngine.Input's keyboard handling are inherited by Rewired.

This bug only affects builds on Linux, not the Linux editor. It also only affects certain versions of Linux.

Unity has already patched the issue in 2018.2.0b2. The change causing this bug was added in some version of Unity after 2017.1.0f3 (see tests below).

UnityEngine.Input.GetKey now toggles on and off in rapid succession frame by frame after a short key-repeat delay. This makes it so that the ButtonDown state becomes true every few milliseconds. Because Unity is telling Rewired that the key going on and off in rapid success, Rewired translates this into GetButtonDown and GetButtonUp every few frames. There's absolutely no way around this other than writing a native keyboard library for Linux and replacing UnityEngine.Input for this portion of input. This may be added in a future release and this page will be updated.

Results of tests:

Ubuntu 14.04 + Unity 5.0.0f4 = No issue
Ubuntu 14.04 + Unity 2017.1.0f3 = No issue
Ubuntu 14.04 + Unity 2017.4.2f2 = No issue
Ubuntu 14.04 + Unity 2018.1.0f1 = No issue
Ubuntu 14.04 + Unity 2018.2.0b2 = No issue

Ubuntu 17.04 + Unity 5.0.0f4 = No issue
Ubuntu 17.04 + Unity 2017.1.0f3 = No issue
Ubuntu 17.04 + Unity 2017.4.2f2 = PROBLEM
Ubuntu 17.04 + Unity 2018.1.0f1 = PROBLEM
Ubuntu 17.04 + Unity 2018.2.0b2 = No issue <- Unity patched the issue

 


 

Unity Editor (all platforms):

 

Rewired increases compile time and load time after pressing Play in the editor

The additional load time can be attributed entirely to Unity loading the serialized data from Rewired's many controller definitions which are used to recognize, map, and calibrate known controllers. The simple fact that the controller data files are linked from an object field in the Rewired Input Manager GameObject's component causes Unity to load those objects regardless of whether the GameObject is enabled or not. Unfortunately there's nothing that can be done to reduce it except to remove controller definitions to reduce the number that have to be loaded.

Unity has to deserialize all the controller definition data every time you press Play or recompile scripts. There isn't any way to both keep the support for all these controllers and get the startup time any faster without completely overhauling the controller definition system to use a database or some other means to store all this data. Doing that would bring all kinds of other challenges and issues because it would have to be cross-platform and work on every single platform Unity supports (22+ now) and would invalidate any custom controller definitions created by users. Rewired was written using the "Unity way" of doing things, using their data storage structures, built-in systems, and editors. Unfortunately, this means I don't have control over every single aspect of the process.

While this increase in startup time may be significant to a blank project, in a real game project, it's likely that the game itself's startup time would be significantly greater than this and therefore the perceived impact would be much smaller vs a blank scene.

It is worth noting that there is no perceivable difference in load time in a final build. A completely blank scene and a scene with an enabled Rewired Input Manager both start instantaneously (Unity splash screen disabled.) This is only an issue in the Unity editor.

How to temporarily remove Controller definitions to speed up development

The fewer controllers supported, the less the delay when the app domain is rebuilt. Just click the "ControllerDataFiles" field in the Rewired Input Manager inspector which will take you to the default ControllerDataFiles object in the Rewired directory, copy the existing ControllerDataFiles, move the copy outside the Rewired folder, link the new ControllerDataFiles in the Rewired Input Manager inspector, then go to the new ControllerDataFiles inspector and remove all the controllers you don't need while doing your development. You can pare this down to like 10 controllers (Xbox, DS4, etc.) and Rewired will add zero extra startup time. Remember to link back the original ControllerDataFiles in the Rewired Input Manager before building so all controllers are supported.

 


Serialized data corruption after importing Rewired

Unity has a major bug in the Unitypackage importer that can lead to data corruption when importing an asset from the Unity Asset Store or a Unitypackage file.

If your Unity Editor Settings -> Asset Serialization Mode is set to "Force Binary", serialized data may be corrupted when you import a Unitypackage. This often happens when a new Unitypackage is imported. If you then re-import the same package over the previous import, it will be imported correctly. If you then delete the imported files and re-import them, they will be corrupted again.

Corrupted serialized data in Rewired can manifest itself as inexplicable errors and exceptions being thrown for no reason making Rewired completely unusable. The best thing to do in this case is to change the Asset Serialization Mode to "Mixed" or "Force Text" and re-import Rewired. If that's not possible or you don't want to have to wait for all your assets to be re-imported in the new serialization mode, import the Rewired asset twice in a row (do not delete the Rewired folder after the first import). The serialized data should be intact after the second import.

This bug has been reported to Unity. They have been able to reproduce it and have sent it to the developers for resolution. No ETA was given.

Last tested version: Unity 5.3.5f0

Please note that this is a Unity bug and can affect any asset. This is not an issue with Rewired.

 


Serialized data corruption after upgrading Unity

Unity's data serializer has bugs which can cause serialized data in scenes and prefabs to become corrupt after upgrading Unity and allowing it to re-import the assets. This normally seems to happen with serialized strings. If you've recently upgraded Unity and you start seeing weird errors or warnings logged about Actions missing that have long nonsense string names, your serialized data may have been corrupted in Unity. There is no way to fix this other than to restore a backup. For this and many other reasons, it's imperative that you back up your project before upgrading Unity.

Please note that this is a Unity bug and can affect any asset. This is not an issue with Rewired.

 


Installer error in Rewired 1.1.8.1

Rewired 1.1.8.1 shipped with a bug that causes the installer to report an error upon installation in Unity 4.x and 5.x. Unity 2017 doesn't appear to have this issue.

Changes were made to the installer system in 1.1.8.1 to use a folder GUID to locate the Rewired folder. Rewired has to be able to determine the path of the main Rewired folder so it can handle file management (installing addons, documentation, etc.) Rewired previously used Rewired_Core.dll as a fixed locator to find the main Rewired folder. Some users wanted to be able to move the Rewired_Core.dll to another location, but doing so before would cause Rewired's editor scripts to fail because Rewired could no longer find its main folder. A change was made in 1.1.8.1 to use the GUID of the Rewired/Internal folder to locate the Rewired folder instead. However, Unity 4.x and 5.x do not preserve the GUID of folders in the Unitypackage making this new technique completely fail. Rewired 1.1.8.2 corrects this error.

Workaround Instructions:

  • First, enable visible meta files. This is done by selecting Edit->Project Settings->Editor in the application menu and enabling External Version Control support by selecting Visible Meta Files in the dropdown for Version Control.
  • Next, open Assets/Rewired/Internal.meta in a text editor.
  • Change the GUID in the .meta file to:
    8cdcfdd141b51d5458f981aaf449fd9f
  • You may need to quit and restart the Unity editor for the change to take effect.

 


IL2CPP: _p0_marshaled': undeclared identifier error on Unity 5.3.2p1, 5.3.2p2

Unity's 5.3.2p1 patch introduced a new IL2CPP error when building Rewired_Core.dll. This affects all platforms that use IL2CPP including iOS and Windows 10 Universal (IL2CPP scripting backend).

This is not an error in Rewired and there is no workaround for it. The only solution is to revert back to Unity version 5.3.2f1. Unity has announced the bug will be fixed in 5.3.2p3. More details can be found here.

 


Compiler error in 5.1.2 patch releases

Unity made an undocumented breaking change to UnityEngine.EventSystems.PointerInputModule.GetMousePointerEventData(). It now requires int id to be passed. This cannot be fixed automatically in my code until Unity 5.1.3 is released because there is no way to detect a patch version before compile.

More information and a patch:
http://forum.unity3d.com/threads/rewired-advanced-input-for-unity.270693/page-20#post-2216921

 


InputManager_Base.Update generates 17 bytes of GC Alloc per frame in the Profiler

This is normal and unavoidable and only happens in the UnityEditor. It is due to a bug/change in Unity 2017.

The InputManager.cs script included in the project calls UnityEditor.EditorApplication.isCompiling every frame in the Editor. This call generates a 17 byte memory allocation every time. This does not generate garbage in Unity 4 or 5 but does in Unity 2017.

This call is required to be able to detect when the Editor is compiling for various needs in the Editor. Again, it happens only in the Unity Editor, not in builds. Rewired generates zero garbage per frame in the normal loop (apart from doing things like control remapping, etc.)

 


"Data Files is missing" error

This can happen for two reasons:

  1. The Data Files field in the Rewired Input Manager inspector is blank.
  2. Serialization errors in some versions of Unity after upgrading Rewired or importing a ControllerDataFiles that replaces the original while the Unity Editor is open.

If #1, link the Data Files field to the ControllerDataFiles included with Rewired at Assets/Rewired/Internal/Data/Controllers/ControllerDataFiles.

If #2, close the Unity Editor and re-launch it.

 


 

Android:

 

Remotes are not detected (Nexus Player, Amazon Fire TV, Razer Forge TV, etc.)

These remotes may not work on versions of Unity 5.02 or greater. Unity introduced a new bug in this version that makes the remote appear with a NULL name in the Input.GetJoystickNames array, which also happens to be used to fill the array entry when a controller is no longer connected. There is no way to identify these remotes because of this. The bug still exists as of 5.3.4f1. It has been reported and this information will be updated if a fix is issued.

The remotes will however still return keycodes through UnityEngine.Input. Most remotes use the keyboard arrow keycodes for movement. In addition, there are various workarounds possible using Custom Controllers such as shown in the following code example:

// Copyright (c) 2016 Augie R. Maddox, Guavaman Enterprises. All rights reserved.

/*  Unity has a significant bug that prevents remotes from being recognized and handled as joysticks in Rewired.
    Therefore, the only workaround is to read the remote as (mostly) keyboard keys through UnityEngine.Input
    directly and feed this input to a Custom Controller. This script will read keyboard keys and
    Joystick Button 0 (on all joysticks) to determine the values to feed into the Custom Controller.
    
    To Use:
    1. Create a gameobject in the scene and assign this component to it and set the Player Id in the inspector.
    2. Create a Custom Controller in the Rewired Input Manager with 8 buttons and 0 axes.
    3. Asssign the Custom Controller to your Player and give it the tag "AndroidRemote".
    4. Create a Custom Controller Map assigning Actions to each button.
    5. Assign the map to your Player.

    The element order is as follows:
    Button 0 = Up
    Button 1 = Down
    Button 2 = Left
    Button 3 = Right
    Button 4 = Center button
    Button 5 = Back button
    Button 6 = Menu button
    Button 7 = Select button
*/

using UnityEngine;
using System;
using Rewired;

public class RewiredCustomController_AndroidRemote : MonoBehaviour {

    public int playerId;
    private const string controllerTag = "AndroidRemote";

    private const int buttonCount = 8;
    private const int axisCount = 0;

    private Rewired.CustomController controller;

    [NonSerialized] // Don't serialize this so the value is lost on an editor script recompile.
    private bool initialized;

    private void Awake() {
        Initialize();
    }

    private void Initialize() {
#if UNITY_ANDROID

        // Find the controller we want to manage
        Rewired.Player player = Rewired.ReInput.players.GetPlayer(playerId); // get the player
        controller = player.controllers.GetControllerWithTag(controllerTag); // get the controller
        if(controller == null) {
            Debug.LogError("A matching controller was not found for tag \"" + controllerTag + "\"");
            return;
        }

        // Verify controller has the number of elements we're expecting
        if(controller.buttonCount != buttonCount || controller.axisCount != axisCount) { // controller has wrong number of elements
            Debug.LogError("Controller has wrong number of elements!");
            return;
        }

        // Subscribe to the input source update event so we can update our source element data before controllers are updated
        Rewired.ReInput.InputSourceUpdateEvent += OnInputSourceUpdate;
        
#endif

        initialized = true;
    }

#if UNITY_EDITOR
    // This is just to handle re-initialization in the editor when recompiling at runtime
    private void Update() {
        if(!Rewired.ReInput.isReady) return; // Exit if Rewired isn't ready. This would only happen during a script recompile in the editor.
        if(!initialized) Initialize(); // Reinitialize after a recompile in the editor
    }
#endif

    private void OnInputSourceUpdate() {
        GetSourceButtonValues();
    }

    private void GetSourceButtonValues() {
        // Get values from the keyboard and joysticks
        controller.SetButtonValue(0, Input.GetKey(KeyCode.UpArrow));
        controller.SetButtonValue(1, Input.GetKey(KeyCode.DownArrow));
        controller.SetButtonValue(2, Input.GetKey(KeyCode.LeftArrow));
        controller.SetButtonValue(3, Input.GetKey(KeyCode.RightArrow));
        controller.SetButtonValue(4, Input.GetKey(KeyCode.JoystickButton0)); // Center button - Must use Joystick Button 0 on ALL joysticks because there's no way to know which joystick if any is the remote because of Unity's bug!
        controller.SetButtonValue(5, Input.GetKey(KeyCode.Escape)); // Back
        controller.SetButtonValue(6, Input.GetKey(KeyCode.Menu)); // Menu
        controller.SetButtonValue(7, Input.GetKey(KeyCode.KeypadEnter)); // Select
    }
}


Joysticks do not sent connect/disconnect events, multiple joysticks appear when the same joystick is unplugged and re-plugged

Unity introduced new bugs in Unity 5.5.0 that cause joysticks to not disappear on disconnect and create new additional joysticks every re-connect. This bug was fixed in 5.5.2p2 and 5.6.0b6. Upgrade to any Unity version after those and the issue will not be present.

 


IL2CPP: Editor crashes or takes a very long time to compile or stalls forever

A bug in Android NDK r13b causes compilation to take an extremely long time or stall forever. The only solution to this bug is to update to a newer version of Rewired or the NDK.

The NDK bug is known to affect these versions of Rewired:

  • 1.1.12.1
  • 1.1.13.0

Rewired 1.1.14.0+ is known to work correctly.

 


 

iOS / tvOS:

 

iOS/tvOS: Game controllers not detected

In Unity versions 5.3.0+, game controllers no longer work in Unity because the XCode project Unity builds does not automatically reference the required GameController framework.

Solution: Manually add a reference to the GameController or GameKit framework in XCode.

More details of this issue and the solution can be found here.

 


Apple TV Siri Remote gyroscope does not work

The Apple TV SDK does not expose the raw gyroscope data and thus it is unavailable. The only data that is avalilable is the gravity vector and user acceleration.

 


Xbox One

 

Controller connections and disconnections do not work

There have been reports of controller connections and disconnections not working on Xbox One builds in Unity 2017.3. This issue is not with Rewired but with the underlying Unity Xbox One input event used to detect controller connections and disconnections. Apparently, Unity's Build and Run with Push method makes any build consecutive to the first one exhibit broken controller connections. Changing build method to Package seems to make the game build properly.

 


 

Ouya:

 

Ouya SDK: Unity input joysticks do not work when the Ouya SDK is installed

When the Ouya Everywhere SDK is installed in the project, it interferes with Unity's input system on Android builds preventing any joystick axes or buttons from working. At present, there is no known solution to make Unity input work on Android when the Ouya SDK is installed. However, Rewired includes support for the Ouya SDK which will allow you to use the Ouya SDK for joystick input. See the Special Platform Support - Ouya for installation instructions.

 


Ouya SDK: Cannot use more than 4 controllers

When using the Ouya Everywhere SDK for joystick support, you cannot use more than 4 controllers. If you attach additional controllers beyond the 4-controller limit, the controller will be assigned to one of the same id's as another controller and both will control the same player. This is a limitation of the Ouya SDK, not Rewired.

 

 


 

SDL2:

OSX - Editor does not support haptic feedback

Due to a bug in SDL/Unity that causes an editor crash when enabled, haptic feedback (vibration) is not supported in the OSX Editor.

Note: This issue only applies if SDL2 is selected as the input source for OSX Standalone builds.

 


OSX - XBox 360 Controller does not support vibration

SDL2 does not provide vibration support for the XBox 360 Controller on OSX.

Note: This issue only applies if SDL2 is selected as the input source for OSX Standalone builds.

 


Windows - XBox 360 Controller does not allow independent control of vibration motors

SDL2's haptic feedback system only accounts for a single motor for rumble devices.

Note: This issue only applies if SDL2 is selected as the input source for Windows Standalone builds.


Steam

Windows - Tab and Shift keys get stuck on after opening Steam overlay using the keyboard

When opening the Steam overlay with Shift + Tab key combination, the Shift and Tab keys will remain stuck on forever until the user presses each of these keys to release them.

This is due to the fact that Rewired uses Raw Input for keyboard input. Steam does not forward the Raw Input key up events for these keys to the application when the overlay is opened, therefore Rewired cannot know that these keys were ever released.

The only workaround at present is to disable Native Keyboard Handling in Rewired Editor -> Settings -> Windows. This makes Rewired use Unity input for the keyboard input source. Unity input does not have this issue because it uses the older Windows keyboard API and Steam does forward the messages using this older API.