Known Issues
Topics:
General
- Compatibility with Unity's "new" input system
- Unity Physical Keys setting
- Keyboard key names are incorrect on non-US 101-key keyboards
- All platforms compiled with IL2CPP on Windows: Builds never finish, build fails with errors, builds crash, built exe hangs at launch, or builds throw exceptions about duplicate Actions
- Running in a Sandbox
Windows:
- Windows Standalone, Use Windows Gaming Input: Stall when Unity Editor or application is closed
- Windows Standalone: Xbox Series S/X controllers do not work when application is out of focus when Use XInput is disabled.
- Windows Editor: Keyboard keys sticking for the same duration they were pressed after being released
- Windows Standalone: Extra 10 second stall when pressing Play in the Unity editor and when running a build
- Windows Standalone, IL2CPP: Rewired falls back to Unity input
- Windows Standalone, Direct Input: Joysticks not detected when using .Net 4.6 scripting backend
- Windows Editor: Crash in Unity 5.6+ with Oculus Touch
- Windows Platforms: XInput devices on Windows appear as "XInput Gamepad"
- Windows Platforms: All XInput devices use the Xbox 360 Controller map when "Use XInput" is enabled
- More than 4 XBox controllers cannot be used at the same time
- Windows Standalone (Use XInput enabled): Wireless Bluetooth Xbox One Controllers cause frame rate drop when disconnected during vibration
- Windows Standalone (Use XInput enabled, Windows 10 Insider Preview): Game crashes when using or plugging in an XInput-compatible controller.
- Windows Standalone (Unity Fallback, Windows 10): Xbox One Controller L/R and D-Pad mapping problems
- Windows Standalone (Raw Input, Windows 10): XBox One controller causes system crash when removed when using Raw Input on Windows 10
- 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
- Windows Standalone (Windows 10): Xbox One Controller stops working after another controller is unplugged
- Windows Standalone (Windows 10): Game Center popup keeps appearing when pressing keyboard keys
- Windows Standalone (Unity Fallback, Windows 10): XBox One controller has incorrect mapping
- Windows Standalone: Nvidia Shield Controller problems on Raw Input and Direct Input
- Windows Standalone, .NET 4.6 experiemental backend: Application freezes on exit in Unity 2017
- Windows Standalone, .NET 4.6 experimental backend: Editor corruption in Unity 2017.1
- Windows Editor: <RI.Hid> Failed to create device file: 2 The system cannot find the file specified.
- 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
- Windows App Store support not working in Unity 5.0.0, fixed in 5.0.1
- Windows Standalone: High refresh rate mouse causes slowdown and profiler spikes
Windows 10 Universal (UWP):
- Windows 10 Universal: IL2CPP build error (no further information about what managed code was being converted is available)
- Windows 10 Universal: Certain gamepads appear twice when HID device support is enabled
- Windows 10 Universal IL2CPP: Crash when disconnecting controllers
- Windows 10 Universal: Left Shift is activated when Right Shift is pressed
- Windows 10 Universal .NET: UnityException: Failed to run reference rewriter error on Unity 5.5.0, 5.5.1
MacOS:
- MacOS: Application freezes forever when initializing Rewired
- MacOS, Apple Silicon: Build crashes when a controller is connected
- MacOS, IL2CPP: Rewired falls back to Unity input
- MacOS, .NET 4.6 experimental backend: Throws exception on initialization in Unity 2017.1 - Unity 2017.3
- MacOS: Game Controller Framework
Linux:
- Linux, IL2CPP: Rewired falls back to Unity input
- Keyboard keys stuck on Linux in Unity 5.1.1
- Keyboard keys repeat when held on Linux in builds
Unity Editor (all platforms):
- Rewired stops working when changing scripts in Play mode with "Recompile After Finished Playing" option
- Compiler error in Unity 2019.1.5f1 when Control Mapper installed
- Assembly errors in projects upgraded to Unity 2019.2
- Assembly and build errors in Unity 2019.3 alpha/beta
- Rewired increases compile time and load time after pressing Play in the editor
- Serialized data corruption after importing Rewired
- Serialized data corruption after upgrading Unity
- Installer error in Rewired 1.1.8.1
- IL2CPP: _p0_marshaled': undeclared identifier error on Unity 5.3.2p1, 5.3.2p2
- Compiler error in 5.1.2 patch releases
- InputManager_Base.Update generates 17 bytes of GC Alloc per frame in the Profiler
Android:
- Remotes are not detected (Nexus Player, Amazon Fire TV, Razer Forge TV, etc.)
- Joysticks do not send connect/disconnect events, multiple joysticks appear when the same joystick is unplugged and re-plugged
- IL2CPP: Editor crashes or takes a very long time to compile or stalls forever
iOS/tvOS:
- Gamepad Pause button and Siri Remote Menu button don't work
- iOS/tvOS 13: Gamepad left stick X doesn't work
Xbox One:
SDL2:
- OSX - Editor does not support haptic feedback
- OSX - Xbox 360 Controller does not support vibration
- Windows - XBox 360 Controller does not allow independent control of vibration motors
Steam:
General:
Compatibility with Unity's "new" input system
Update: As of Unity 2021.2.0f1, Rewired can now work alongside Unity's new input system on Windows. If you need to use both Rewired and Unity's new input system simultaneously, update to Unity 2021.2.0f1+. To use both together, use the following setting:
Player Settings -> Active Input Handling -> Both
Note: The only platform with known issues running both systems together was Windows Standalone. If other incompatibilites exist on other platforms, they are currently unknown and untested.
For versions prior to 2021.2.0f1:
Rewired is not compatible with Unity's new input system. If you enable the new input system by setting this value to "Input System" or "Both", Rewired and/or Unity's input system may not function at all or parts of each system may not function correctly. While some platforms may work, others may not.
The only setting supported by Rewired is:
Player Settings -> Active Input Handling -> Input Manager
Unity Physical Keys setting
Unity added the Physical Key option in Unity 2021.2 and made it enabled by default in 2022.0.
https://docs.unity.cn/Manual/class-InputManager.html
If enabled, keyboard keys will map to their physical location on a US 101-key keyboard regardless of the keyboard layout being used (AZERTY for exampe). This is useful for making a locale-independent input layout. Example: WASD to move.
The problem is, if enabled, the KeyCode returned for a key will match the US 101-key layout, and glyphs and help text will display incorrect information to the user. For example, the A key on a AZERTY keyboard is located where the Q key is on a US 101-key keyboard, and the KeyCode returned for the A key will be KeyCode.Q. Unity added the Physical Keys setting but neglected to add a function which would get the key label for the key code. This makes it impossible to display accurate help text or glpys to the user if this option is enabled. This affects anything that might need to display a key name including Control Mapper.
Because of the above issue, it is recommended to disable Physical Keys in the Unity Input Manager settings. A toggle box has been added to the Rewired Input Manager -> Settings page for easy access to this setting (Unity 2021.2+).
If you choose to use Physical Keys, native keyboard handling will be automatically disabled on all platforms that support it because it does not support Physical Key mapping and Unity fallback keyboard handling will be used instead, allowing you to use Physical Key mapping.
Keyboard key names are incorrect on non-US 101-key keyboards
This happens when the Unity "Physical Keys" option is enabled and cannot be fixed. See this for more information.
All platforms compiled with IL2CPP on Windows: Builds never finish, build fails with errors, builds crash, built exe hangs at launch, or builds throw exceptions about duplicate Actions
Update: This issue no longer affects Rewired 1.1.40.0+. Update to the latest version of Rewired.
The latest version at the time of writing this, Visual Studio 2019 16.8.6, still exhibits this error.
Due to a new compiler bug in Visual Studio 2019 16.5+, when built with IL2CPP using the Unity Editor on Windows with Visual Studio 2019 installed, the build may never finish (hang during compile), crash during compile, the built executable may hang after launch, or they may throw exceptions about duplicate Actions, or potentially unlimited other possible manifestations. This issue can be avoided by uninstalling Visual Studio 2019 and installing Visual Studio 2017, or you can use one of the following workarounds to make builds work again in VS 2019.
Update: This has been updated to disable just the jump threading optimizer instead of the entire SSA optimizer based on feedback from Microsoft.
I have tracked the issue down to a bug in the new optimizer used in VS2019.
- This affects Release and Master builds, not debug builds.
- You can disable the new optimizer in the VS generated IL2CPP build project by adding the following to the end of the IL2CPP command line:
--compiler-flags=-d2ssa-cfg-jt-
Option 1: Editor Script (Probably the best solution)
- Download the DisableNewVS2019Optimizer script and extract the cs file.
- Create a folder somewhere in your Unity project's Assets folder and name it Editor.
- Copy the DisableNewVS2019Optimizer.cs script into the Editor folder.
- Now IL2CPP builds on Windows will automatically have the new optimizer disabled, but it won't affect builds to other build targets.
- Note that this method will not automatically copy the compiler flag options to the Visual Studio project if you choose to make an IL2CPP build with the "Create Visual Studio Solution" option in the build window. If "Create Visual Studio Solution" is enabled, you will have to manually add the compiler option by following the instructions under Option 2: Manual Build below.
- Note that you will get a compiler error if you use this script and do not have Visual Studio 2019 installed as VS 2017 or other versions do not have this compiler flag option.
- Deleting the script will not remove the compiler option if it has already been set. You can remove it by editing ProjectSettings\ProjectSettings.asset in a text editor under the heading additionalIl2CppArgs.
Steps:
- Set Unity Build Settings -> PC, Mac & Linux Standalone -> Create Visual Studio Solution
- Build
- Open solution in Visual Studio
- Right click the IL2CPPOutputProject project in the Solution Explorer and select Properties.
- Make sure you have the correct build Configuration selected at the top for the type of build you want to make (Master, Release, etc).
- Go to the NMake page
- On the Build Command Line field, add to the end (adding a space first):
- --compiler-flags=-d2ssa-cfg-jt-
- Compile
- Run
- No more infinite loops
On Windows, another easier way to disable the optimizer is to add an environment variable. Be advised, this may cause IL2CPP builds for other build targets to fail because I assume it will add the compiler option regardless of the build target:
- Click Start Menu
- Type environment
- Launch "Edit the system environment variables"
- Under "User Variables for USERNAME", click New.
- Set the variable name to: IL2CPP_ADDITIONAL_ARGS
- Set the variable value to: --compiler-flags=-d2ssa-cfg-jt-
- Press Ok.
- Close all copies of the Unity editor and re-open it.
- Direct IL2CPP builds (without creating VS solution) will now work correctly.
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, Use Windows Gaming Input: Stall when Unity Editor or application is closed
Applies to Unity 5 - 2021, Mono scripting backend:
When Use Windows Gaming Input is enabled, if a controller was ever connected during the applciation session, when the application is quit (Unity Editor or a game build), the application will stall for at least 30 seconds before closing. The cause has been traced to the use of unmanaged to managed callbacks in Mono. Callbacks are used to detect Windows Gaming Input controller connection and disconnection events. The issue does not occur in IL2CPP builds or in Unity 2022+.
Windows Standalone: Xbox Series S/X controllers do not work when application is out of focus when Use XInput is disabled
Xbox Series S/X controllers do not work when the application is out of focus. This is a problem at the driver level and is not an issue with Rewired. The driver does not send any Raw Input events to the application when it is out of focus even when explicitly told to do so when registering for Raw Input events. This affects Raw Input, Direct Input, and Unity input sources. This does not affect XInput.
Windows Editor: Keyboard keys sticking for the same duration they were pressed after being released
Update: According to Unity, this bug will be fixed in Unity 2019.4.0f1.
- Unity made a change to the editor update thread in 2019.3.8 (https://unity3d.com/unity/whats-new/2019.3.8 - Editor: Fixed the editor application main thread tick timer throttling causing unwanted spikes and delays. (1211383)) that has resulted in this lag in a very roundabout way. The Windows message queue is having to wait on the editor GUI thread, so heavy CPU usage in the editor GUI update thread now maifests as a severe slowdown to the main thread if messages are waiting to be delivered to it by Raw Input. This issue persists as of 2019.3.15, the latest version, as of the date of this message.
- The more work happening on the editor GUI thread, the worse the slowdown of the main thread will be when it has to wait on a Raw Input event to be delivered.
- This affects Raw Input, presumably because Raw Input relies on the Windows messaging queue for delivery of input events.
- This is most easily reproduced by having the Rewired Input Manager selected in the inspector with the Debug Information foldout open displaying a lot of fields such as when looking at Controllers -> Keyboards and listing all the keys. With this open, the lag after releasing a key when held down for a second or more while is > 1 second. Debug Information makes a lot of calls to Editor Prefs which slows down the editor thread enough to make the new issue visible.
- This also affects Unity's new input system through the exact same mechanism of preventing the Raw Input events from being delivered in a timely manner to the input thread. The lag can be reproduced exactly simply by enabling their new input system and running a CPU-intensive operation in an editor script.
This bug has been reported to Unity with a simple reproduction case using their new input system.
Windows Standalone: Extra 10 second stall when pressing Play in the Unity editor and when running a build
Reports have been coming in recently of a 10 second stall when pressing Play in the Unity editor and when launching the game build. Every single instance of this has turned out to be a problem getting information from some piece of hardware attached to the system. This has happened with Corsair keyboards and a Mayflower Electronics headphone amplifier so far, but could potentially be caused by any HID device.
When a problem device is present, a 5-second stall happens when certain information is queried about the HID device such as getting the Product Name using the Windows API function HidD_GetProductString. This function may be called twice leading to a 10 second stall. This is a problem at the device / driver level and cannot be fixed in Rewired. Because of the sudden influx of reports like this, I can only make the educated guess that this is directly due to a new change in Windows in a recent update resulting in the 5-second stall with these devices. There is no other explanation because none of this code has changed in years, and before 2020, there were zero reports of anything like this from Rewired users.
This issue is not isolated to Rewired. Every single application that calls HidD_GetProductString on these devices will experience this stall. This has been reproduced using a HID library with one of these devices. Microsoft's Direct Input itself is also subject to this issue when getting the list of devices, with reports of this happening on the web. Even Microsoft's USB Game Controller tool in Windows apparently is affected by this, causing stalls and even crashing. There are also reports of this happening with SDL2, a hugely-popular cross-platform library.
This issue cannot be "fixed" because it is not an issue in Rewired but in the underlying device/driver/Windows API. The best way to resolve it is to identify the device or driver causing it and remove it or disable it in Device Manager. Some devices like the Mayflower Electronics headphone amplifier expose a HID device in Device Manager that can be disabled without affecting the functionality of the device itself.
Windows Standalone, IL2CPP: Rewired falls back to Unity input
Support for IL2CPP on desktop platforms was added in Rewired 1.1.22.0.
Solution: Update Rewired.
Windows Standalone, Direct Input: Joysticks not detected when using .Net 4.6 scripting backend
Direct Input was moved into a native DLL in Rewired 1.1.22.0 and therefore no longer has this issue which was caused by the lack of support of a particular IL instruction in the .Net 4.6 scripting backend.
Solution: Update Rewired.
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"
As of Rewired 1.1.47.0, it is now recommended that you enable Use Windows Gaming Input which supports all features of XInput and allows for better device identification. Also, on Windows UWP, Windows Gaming Support was updated to allow differentiation between Xbox 360 and Xbox One controllers in Rewired 1.1.47.0.
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:
- L/R triggers are treated as 1 combined axis and both cannot be pressed simultaneously without canceling each other out.
- 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.
- Vibration is not supported.
Windows Platforms: All XInput devices use the Xbox 360 Controller map when "Use XInput" is enabled
As of Rewired 1.1.47.0, it is now recommended that you enable Use Windows Gaming Input which supports all features of XInput and allows for better device identification.
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
Windows Gaming Input:
As of Rewired 1.1.47.0, it is now recommended that you enable Use Windows Gaming Input which supports more than 4 XInput devices with support for all special controller features.
XInput:
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 but Windows Gaming Input is disabled. If you need to support more than 4 XInput controllers, you can either disable XInput and use Raw/Direct Input or enable Windows Gaming Input in the Rewired Editor - Settings page.
If both "Use XInput" and "Use Windows Gaming Input" are enabled, if Windows Gaming Input is unavalable on the system, XInput will be used as the fallback input source for compatible devices. Otherwise, the primary input source will be used as the fallback input source. This has some important implications. If your game absolutely requires support for more than 4 XInput-compatible devices, it is recommended you enable "Use Windows Gaming Input" but disable "Use XInput" so on systems that do not support Windows Gaming Input, Raw Input / Direct Input will be used as the fallback input source, allowing for more than 4 XInput-compatible devices to be used simultaneously, albeit with the caveats below. Otherwise, enable both "Use XInput" and "Use Windows Gaming Input" for best feature support.
Be advised that by disabling "Use XInput" and "Windows Gaming Input" in the Rewired Input Manager, Raw Input or Direct Input will be used to handle XInput-compatible controllers and will introduce these new issues/limitations:
- L/R triggers are treated as 1 combined axis and both cannot be pressed simultaneously without canceling each other out.
- 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.
- Vibration is not supported.
OSX Standalone
NOTE: This information is outdated. Modern Xbox controllers connected via Bluetooth do not need a driver to be installed. Old Xbox 360 Controllers may, but if using Game Controller Framework, no drivers need to be installed.
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): Wireless Bluetooth Xbox One Controllers cause frame rate drop when disconnected during vibration
The drop in frame rate is not caused by Rewried. It is indirectly caused by Unity, but ultimately the real culprit is XInput. There is nothing I can do to "fix" this issue because it is not caused by Rewired, nor is the CPU spike that causes the frame rate to drop even in Rewired's call stack -- it's in Unity's.
Sequence of events:
- 2 or more Xbox One controllers are attached.
- At least one of these is a Bluetooth controller and connected via Bluetooth.
- Vibrations are being sent continuously to the Bluetooth controller.
- The Bluetooth controller is disconnected (battery dies, etc.).
- XInput still reports this device present for 2 or more seconds.
- The other controller has to be actively producing some input (may just be axis noise in some cases.)
- Unity stalls and stutters until the device is fully disconnected.
During this period where the Bluetooth device has been connected but has not been reported as disconnected:
- Calls to XInput functions do not return with errors.
- Calls to set vibration to XInput on the disconnected device apparently stall out the entire XInput system regardless of which thread is making the calls.
- Calls to read input from XInput take an excessive amount of time, even on a separate thread, because of the calls to set vibration on the other thread.
Rewired already implements multiple separate threads to handle input and output (vibration) for XInput so so lags in function calls to XInput will not result in drops in frame rate. It also caps the frequency of set vibration calls to XInput because of prior problems with Xbox One controllers.
Unity is causing the application frame rate to drop under this scenario, not Rewired. This can be seen in the Unity profiler. The entry UpdateSceneManagerAndInput will report a very long time such as 250ms per frame during this period. This is a Unity function.
This is the best explanation I can come up with for the problem:
- Unity is calling functions in XInput on the main thread that are lagging out due XInput going into some kind of spasm because set vibration is being continuously called on a wireless Bluetooth controller that has been disconnected but XInput has not reported it disconnected yet and is not throwing errors when functions are being called on that device.
- Unity's input system cannot be disabled to avoid this issue.
- Unity could jump through hoops and implement workarounds like moving XInput to another thread, but they can't fix the underlying cause.
- Only Microsoft can fix it.
The only possible workaround is to send fewer vibrations so the disconnecting controller doesn't get hammered with vibrations while it is in the bugged state. Do not spam controllers with vibrations unless you really have to. However, in the case you are playing back some kind of effect sequence, there is no way to avoid it.
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:
- https://forum.unity3d.com/threads/rewired-advanced-input-for-unity.270693/page-66#post-3116639
- https://forum.unity3d.com/threads/rewired-advanced-input-for-unity.270693/page-66#post-3116993
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 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.
Windows Standalone: High refresh rate mouse causes slowdown and profiler spikes
Update: This issue has been fixed by Unity in 2021.2.0f1. Also, a corresponding change had to be made to Rewired due to their new changes to fix this issue, so you must use Rewired 1.1.41.0+ in conjunction with Unity 2021.2.0f1+ to support high refresh rate mice.
A high refresh rate mouse causes slowdowns, high cpu usage, and profiler spikes in Unity. This is not a Rewired issue. It is 100% a Unity issue and cannot be fixed by Rewired.
It has been reported to me numerous times that Rewired is causing high CPU usage causing spikes in the profiler when moving the mouse. The profiler will report a particular function in Rewired_Windows.dll is using many milliseconds of time. This is a false flag. The problem is in Unity, not Rewired.
The only reason Rewired is even shown in this stack trace is because of how the Raw Input mouse event rerouting works. An application may only receive Raw Input events for a particular device type to one single window. Unity requires these events for their mouse input to work. Rewired also needs to receive these events for its Raw Input mouse to work. Rewired creates a message window, subscribes to Raw Input events to this window, then it reroutes the Raw Input mouse events back to Unity when they come in. What happens after that is out of Rewired's control. Unity becomes downstream of Rewired and therefore Rewired ends up in the stack trace.
This is easily proven by performing the same test in a fresh project without Rewired installed. You will see the exact same spikes in the profiler without Rewired anywhere in the mix.
Mice with a 1000+ Hz refresh rate seem to cause the most problems. The higher the rate, the more slowdown.
Windows 10 Universal (UWP):
Windows 10 Universal: IL2CPP build error (no further information about what managed code was being converted is available)
Severity: Critical
Solution: Update to Rewired 1.1.38.4+.
As of Unity 2020.2.0f1, versions of Rewired prior to 1.1.38.4 no longer function on the UWP platform due to a new IL2CPP issue introduced in Unity 2020.2.0f1+.
Exception: IL2CPP error (no further information about what managed code was being converted is available) System.NullReferenceException: Object reference not set to an instance of an object. at Unity.IL2CPP.Extensions.ModuleInitializerMethod(AssemblyDefinition assembly) at Unity.IL2CPP.Metadata.PerAssemblyCodeMetadataWriter.Write(SourceWritingContext context, AssemblyDefinition assembly, GenericContextCollection genericContextCollection, String assemblyMetadataRegistrationVarName, String codeRegistrationVarName)
Windows 10 Universal: Certain gamepads appear twice when HID device support is enabled
Solution: Update to Rewired 1.1.47.0+.
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. Edit: New API functionality has been added by Microsoft that makes device filtering possible and a fix was implemented in Rewired 1.1.47.0.
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:
- Install Unity 5.5.2 or later.
- Install an older version of the Windows 10 SDK also.
MacOS:
MacOS: Application freezes forever when initializing Rewired
- This is actually a Unity bug that happens to affect Rewired. It cannot be fixed or worked around by Rewired.
- The bug is present in the latest versions of Unity as of this writing: Unity 2022.3.12f1 and 2023.1.18f1, Apple M1, MacOS 14.0. The bug has been reported to Unity.
- When a controller is disconnected from the system, there is a small chance that Unity's HID controller handling code will freeze permanently. This appears to be done on a separate thread because it does not cause the application to stop functioning. However, it does stop controllers from ever being detected again until the application or Unity editor is quit. Without Rewired involved, Unity's controller support just simply stops functioning.
- However, if Rewired is initialized at any time after Unity's input system freezes, Rewired's function call to I/O Kit's HID Manager to specify which types of controllers to monitor will block forever causing the entire application to freeze permanently. There is no workaround without Unity fixing the underlying bug that is causing this.
- To minimize the possibility of this affecting a final game, initialize Rewired only once very early in the game initialization sequence and never initialize it again. Even if Unity's input system freezes after controllers are connected and disconnected, it will not affect Rewired in any way so long as Rewired has already been initialized. If the Rewired Input Manager were to be destroyed or disabled, then re-instantiated or re-enabled, Rewired would be required to initialize again and would freeze when I/O HID Manager is being setup. Likewise, do not allow the user to change any runtime settings that require Rewired to be reset such as changing the primary input source or enabling / disabling optional secondary input sources.
MacOS, Apple Silicon: Build crashes when a controller is connected
Unity has a bug that causes a crash when any native code calls back into managed code. This cannot be fixed or worked around. Only Unity can fix this bug and Rewired's native input cannot function without this feature. The only way to get around this issue is to build to IL2CPP.
More information about the Mono bug can be found at the Unity bug tracker.
MacOS, IL2CPP: Rewired falls back to Unity input
Support for IL2CPP on desktop platforms was added in Rewired 1.1.22.0.
Solution: Update Rewired.
MacOS, .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.
MacOS: Game Controller Framework
MacOS, Game Controller Framework: Controller vibration stops working on some controllers when another controller is connected or disconnected
When using the Game Controller Framework, controller vibration can stop working randomly when any Game Controller Framework compatible controller is connected to or disconnected from the system. This is a bug on Apple's end and cannot be fixed by Rewired. Once the vibration motors stop working on the connected controller(s), the only way to make them work again is to disconnect and reconnect the controller.
MacOS, Game Controller Framework: Sony Dual Shock 4 and Dual Sense controller issues
Based on my testing, there are numerous issues with the Dual Shock 4 and Dual Sense controllers when using the Game Controller Framework. These issues are not caused by Rewired but by Apple's Game Controller Framework. There are no software fixes possible.
Issues I have experienced when testing on an M1 Mac connecting wirelessly:
- The entire system stalls during connection of Dual Sense controller for several seconds.
- Some or all special controller features may or may not work, or may stop working.
- Light color may not change when calling SetLightColor.
- Acceleration and/or gyroscope values may not work.
- Vibration motors may not work or may stop working.
The only workaround I have found is to unpair and repair the controller as many times as it takes until the controller starts working correctly. Simply disconnecting and reconnecting the controller does not seem to help. Only unpairing and repairing appears to make a difference.
Linux:
Linux, IL2CPP: Rewired falls back to Unity input
As of Unity 2018.3.0, Unity does not support IL2CPP on Linux. If/when IL2CPP support is added to Unity, Rewired versions of 1.1.22.0+ should automatically just work. Obviously this cannot be tested until Unity adds support for the platform.
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:
https://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 stops working when changing scripts in Play mode with "Recompile After Finished Playing" option
Update: A workaround was added in Rewired 1.1.28.0.
The setting Preferences -> General -> Script Changes While Playing -> Recompile After Finished Playing causes Rewired to stop working when making a change to a script while in Play mode.
Rewired must be able to tell when recompilation starts and ends in order to safely shut down and re-initialize. Rewired uses various functions in the Unity API to determine this. It relies on UnityEditor.EditorApplication.isCompiling to know when this process has started and ended.
When you change the option to "Recompile After Finished Playing", Unity sets the value of UnityEditor.EditorApplication.isCompiling to True immediately when it detects a change to a script even though the application is not actually compiling. It never sets this value back to false because the setting makes it wait until Play mode ends before it can actually recompile. Meanwhile, Rewired has shut itself down when it detected the start of recompilation. It waits until Unity tells it compliation has ended before it reinitializes itself. Since the value from Unity remains False forever, Rewired stays shutdown until Play mode is stopped and restarted. This is a bug in Unity, not Rewired.
Compiler error in Unity 2019.1.5f1 when Control Mapper installed
Update: This was patched in Rewired 1.1.26.1.
Unity made a breaking API change in 2019.1.5f1 even though they are not supposed to make breaking API changes in a minor version update.
Change the line in Rewired/Extras/ControlMapper/Scripts/UISelectionUtility.cs that reads:selectableCount = Selectable.AllSelectablesNoAlloc(ref s_reusableAllSelectables);to
selectableCount = Selectable.AllSelectablesNoAlloc(s_reusableAllSelectables);
All you have to do is remove the ref keyword.
For more information, see this forum post.
Assembly errors in projects upgraded to Unity 2019.2
Update: This bug was fixed in Unity 2020.1.0a13.
Projects upgraded to Unity 2019.2 from a previous version (including a beta version) may report the following errors:
- Error: Could not load signature of Rewired.ComponentControls.Effects.TouchInteractableTransitioner:get_transitionColorTint due to: Could not load file or assembly 'UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null type:member:(null) signature: -Error: Could not load signature of Rewired.Editor.ComponentControls.TouchInteractableEditor:GenerateInteractableAnimatorContoller due to: Could not load file or assembly 'UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null type: member:(null) signature:
This error is not an error in Rewired. It's an error in Unity's upgrade process due to changes they've made moving the UI assembly to the Package Manager. This error does not occur in a new 2019.2.0f1 project that has not been upgraded.
The resolution to this issue is to simply ignore the errors. They will not be shown again when the editor is closed and restarted. Note, the errors may return if doing a "Reimport All" operation, but again, they're just costmetic.
Assembly and build errors in 2019.3 alpha/beta
First, alpha, beta, preview, and experimental, versions and features of Unity are not suppored.
Rewired may not be compatible with Unity 2019.3 alpha. If you install Rewired you may see the following errors:
Assembly 'Assets/Rewired/Internal/Libraries/Editor/Rewired_Editor.dll' will not be loaded due to errors: Unable to resolve reference 'UnityEngine.UI'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector. Assembly 'Assets/Rewired/Internal/Libraries/Runtime/Rewired_Core.dll' will not be loaded due to errors: Unable to resolve reference 'UnityEngine.UI'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector. Assembly 'Assets/Rewired/Internal/Libraries/Runtime/Rewired_Windows.dll' will not be loaded due to errors: Reference has errors 'Rewired_Core'.
Unity has made a major breaking change. The Unity UI library has been moved from UnityEngine.UI.dll as part of the core Unity installation to Unity.ugui.dll as an optional install through the Package Manager. This change to the DLL name which breaks all assembly references in Rewired's DLLs. This issue affects all DLLs that reference Unity UI, not just Rewired, including many of the most popular assets on the Unity Asset Store. There is no possible workaround to this issue.
Unity has acknowledged these changes as a mistake and has made changes to allow DLLs to work again in a later alpha/beta release. See this forum thread for more details. However, even though they have made changes to make it work again, it does have side effects with possible errors being reported when upgrading a project from an older version of Unity. See this for more information.
You may also get the following error when you try to make a build. This error will go a way the next time you attempt a build, but will come back at the following build. Every other build attempt will result in the following failure. This is a known Unity issue and has a bug tracker page here. Update: This bug has reportedly been fixed in the latest 2019.3 beta and 2020.1 alpha.
Type '[Rewired_Core]Rewired.ComponentControls.Effects.TouchInteractableTransitioner' has an extra field '_transitionColorTint' of type 'UnityEngine.UI.ColorBlock' in the player and thus can't be serialized (expected '_syncFadeDurationWithTransitionEvent' of type 'System.Boolean') ... Fields serialized in target platform, class 'Rewired.ComponentControls.TouchInteractable' '_interactable' of type 'System.Boolean' '_visible' of type 'System.Boolean' '_hideWhenIdle' of type 'System.Boolean' '_allowedMouseButtons' of type 'Rewired.ComponentControls.TouchInteractable+MouseButtonFlags' '_transitionType' of type 'Rewired.ComponentControls.TouchInteractable+TransitionTypeFlags' '_transitionColorTint' of type 'UnityEngine.UI.ColorBlock' '_transitionSpriteState' of type 'UnityEngine.UI.SpriteState' '_transitionAnimationTriggers' of type 'UnityEngine.UI.AnimationTriggers' '_targetGraphic' of type 'UnityEngine.UI.Graphic' '_onInteractionStateTransition' of type 'Rewired.ComponentControls.TouchInteractable+InteractionStateTransitionEventHandler' '_onVisibilityChanged' of type 'Rewired.ComponentControls.TouchInteractable+VisibilityChangedEventHandler' '_onInteractionStateChangedToNormal' of type 'UnityEngine.Events.UnityEvent' '_onInteractionStateChangedToHighlighted' of type 'UnityEngine.Events.UnityEvent' '_onInteractionStateChangedToPressed' of type 'UnityEngine.Events.UnityEvent' '_onInteractionStateChangedToDisabled' of type 'UnityEngine.Events.UnityEvent'
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:
https://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.
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 send 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
Gamepad Pause button and Siri Remote Menu button don't work
This is a Unity bug. They introduced this bug when they added support for iOS 13. This bug affects various versions of Unity 2018.4, 2019.2, 2019.3, and 2020.1. This bug was fixed in the 2018.4, 2019.3, and 2020.1 branches. The bug tracker can be found here.
The easiest way to fix this problem is to update Unity to a version that contains the fix. If you are using a version of Unity that was not updated and you do not want to update it, see these messages for a workaround:
https://forum.unity.com/threads/rewired-advanced-input-for-unity.270693/page-119#post-5430810
https://forum.unity.com/threads/rewired-advanced-input-for-unity.270693/page-119#post-5438304
iOS/tvOS 13: Gamepad left stick X doesn't work
This is a Unity bug. They introduced this bug when they added support for iOS 13. This bug affects various versions of Unity 2018.4, 2019.2, 2019.3, and 2020.1
Edit the iPhone_Sensors.mm file generated by Unity in the Xcode project:
https://forum.unity.com/threads/rewired-advanced-input-for-unity.270693/page-119#post-5438304
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.
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.