Rewired - Advanced Input for Unity

For the Sony Dualshock 4, there is a "Touchpad Button", I just played Bloodborne yesterday and they have two different actions for pressing right or left on the touchpad, I'm assuming there is a way to know where the thumb is on the trackpad, does Rewired support that?

For the Sony Dualshock 4, there is a "Touchpad Button", I just played Bloodborne yesterday and they have two different actions for pressing right or left on the touchpad, I'm assuming there is a way to know where the thumb is on the trackpad, does Rewired support that?

We are getting the same error as we would for using a 2018 install in a 2017 install - but I have literally closed Unity, created a new project, then immediately installed Rewired. A clean install is impossible, either it downloads the wrong Rewired or it is incompatible with Rewired for 2017. I don't know how to check for a version because Unity quickly becomes unusable with Rewired installed.

We're using this version of Unity because it's the current stable release for Nintendo Switch development. I've tested the compiler directives and UNITY_2018 doesn't show up, so it's not like they've messed up those flags (UNITY_2017 and UNITY_2017_4 both execute code). This build of Unity is the one currently highlighted in blue on the Nintendo Developer Portal if you want to verify this yourself.

The Unity Asset Store will automatically download the correct branch for the version of Unity you are using when downloading an asset. However, it does have bugs. If you have downloaded Rewired in a newer or older major version of the Unity editor, that version of the file will be cached in the Asset Store download location. The exact same download location is used for all versions of Unity from 5.0 onward, so when you switch to a different major version of Unity, the Unity Asset Store installer will install a copy of Rewired which was downloaded for a different version of Unity. The only solution is to delete the cached download and re-download it in Unity editor. See the Unity Manual for location of the Asset Store files.

The above applies to newer versions of the editor as well. If you have Unity 2018 installed and have downloaded Rewired in it, you then open Unity 2017 and install it from the asset store and it will be installing the Unity 2018 version cached on your hard disk. The other error you posted is probably because the Unity 2018 DLL has some reference to a class or in the Unity 2018 API that doesn't exist in 2017.

Deleted the Rewired folder from the Asset store cache and did a clean install. Everything works fine now. I did this with an empty project just to be sure.

Thanks for the prompt reply, apologies for missing the info in the troubleshooting section.

Anyone else finding this who has the same issue, delete the Rewired folder from your Asset Store cache.

macOS: ~/Library/Unity/Asset Store

Windows: C:\Users\accountName\AppData\Roaming\Unity\Asset Store

Click to expand...

Glad it's working.

This Asset Store issue is the reason I put the warnings in there to tell you when you've installed the wrong version. The warning logged also contains this information:

...Some different major versions of Unity download Asset Store assets to the same folder location on disk, so if you download an asset in one version of the Unity editor, then open another version of the Unity editor and install the asset without re-downloading it, the wrong asset version will be installed. To fix this, manually re-download Rewired in the Unity Asset Store panel in this version of the Unity Editor, then install it....

So here is my problem. I'm building a fighting game, When I press START I want the game to pause. And It does, and thats great, I slow down time and bring up the PAUSE menu.

But when I press the up and down, you know to scroll through the pause menu this also effects the characters FSM, for instance if I press pause when the character is in the middle of an attack and than I press down to scroll through the pause menu it also tells the character to go down or whatever...

My solution for this was to change the PLAYER IDs to a high number (when the pause menu was active) so that the input wouldn't work on the players when the PAUSE menu was active. And this worked great. But now something happened and it does not work anymore. I now get an error that says:

P1_NINJA : FSM : IDLE RIGHT : IntCompare : Rewired Player Id is out of range... Do you know why this happened.

Do you have any suggestions ? Or a better solution for my problem ? Mind you I cant just turn off the FSM because than when I would turn it back on it would take it back to IDLE. And The idea is to pause the game and than un-pause it and pick up where I left...

So here is my problem. I'm building a fighting game, When I press START I want the game to pause. And It does, and thats great, I slow down time and bring up the PAUSE menu.

But when I press the up and down, you know to scroll through the pause menu this also effects the characters FSM, for instance if I press pause when the character is in the middle of an attack and than I press down to scroll through the pause menu it also tells the character to go down or whatever...

My solution for this was to change the PLAYER IDs to a high number (when the pause menu was active) so that the input wouldn't work on the players when the PAUSE menu was active. And this worked great. But now something happened and it does not work anymore. I now get an error that says:

P1_NINJA : FSM : IDLE RIGHT : IntCompare : Rewired Player Id is out of range... Do you know why this happened.

Do you have any suggestions ? Or a better solution for my problem ? Mind you I cant just turn off the FSM because than when I would turn it back on it would take it back to IDLE. And The idea is to pause the game and than un-pause it and pick up where I left...

I'm using rewiredPlayer.GetAxis (RewiredConsts.Action.CharacterRotate);
to get the axis input. (Mouse/Controller)
Is there a way to get the input without the sensitivity applied to the input?
I just want to get the input without factoring in any sensitivity.
Thanks.

I'm using rewiredPlayer.GetAxis (RewiredConsts.Action.CharacterRotate);
to get the axis input. (Mouse/Controller)
Is there a way to get the input without the sensitivity applied to the input?
I just want to get the input without factoring in any sensitivity.
Thanks.

Click to expand...

No. You have to set your Input Behavior sensitivity values to 1.0 if you want the value unmodified by sensitivity settings.

Changes:
- Added support for IL2CPP scripting backend on Windows Standalone and OSX Standalone platforms.
- Changed editor detection of Rewired installation folder for compatibility with moving Rewired into a Package Manager package. Note: Using Rewired as a Package Manager package is not recommended and support for issues encountered when doing so will not be provided.
- Modified Rewired Standalone Input Module and Touch Controls to remove checks for UnityEngine.Input.touchSupported in order to allow Unity Remote touch input to work properly when run on an editor platform that does not support touch input.
- Updated SimpleControlRemapping example.
- Updated SimpleCombinedKeyboardMouseRemapping example.

All pages except the home page are downloading instead of displaying in the browser. Nintendo Switch plugin won't update either - I cannot use Rewired, it's throwing errors and I installed it to test Switch joycons.

All pages except the home page are downloading instead of displaying in the browser. Nintendo Switch plugin won't update either - I cannot use Rewired, it's throwing errors and I installed it to test Switch joycons.

Good luck fixing the site. Please give us an update when it's fixed.

Click to expand...

Webhosting issues. Nothing was changed on the website by me. Something has change on the webhost's end. Probably some server update or something that broke everything.

cannot use Rewired, it's throwing errors and I installed it to test Switch joycons

Click to expand...

Rewired does not require or use a connection to the internet for anything. The Nintendo Switch Plugin has an auto-update option, but internet is not required to use it. Contact me privately to discuss the Nintendo Switch plugin. Tell me what errors you are seeing.

Is it possible to get the same fix for DE keyboards? Our DE users have to press Ö in order to trigger "KeyCode.BackQuote".

Click to expand...

This wasn't a fix. It was adding explicit support for a non-US keyboard layout to accommodate some user who wanted this. UnityEngine.Input doesn't support these keyboard explicitly -- you'll see the same behavior in UnityEngine.Input. Neither does Rewired because Rewired's keyboard support was modeled directly after UnityEngine.Input's to be 100% mapping compatible with UnityEngine.KeyCode. There was no plan to add explicit support for non-US keyboards to Rewired. This is one of those "if I do it for one, I have to do it for everyone" problems.

This wasn't a fix. It was adding explicit support for a non-US keyboard layout to accommodate some user who wanted this. UnityEngine.Input doesn't support these keyboard explicitly -- you'll see the same behavior in UnityEngine.Input. Neither does Rewired because Rewired's keyboard support was modeled directly after UnityEngine.Input's to be 100% mapping compatible with UnityEngine.KeyCode. There was no plan to add explicit support for non-US keyboards to Rewired. This is one of those "if I do it for one, I have to do it for everyone" problems.

Click to expand...

Ah, I understand that. Well, if you ever get crazy bored and decide "what layout to add..." feel free to add DE Thanks anyways.

Changes:
- Added support for IL2CPP scripting backend on Windows Standalone and OSX Standalone platforms.
- Changed editor detection of Rewired installation folder for compatibility with moving Rewired into a Package Manager package. Note: Using Rewired as a Package Manager package is not recommended and support for issues encountered when doing so will not be provided.
- Modified Rewired Standalone Input Module and Touch Controls to remove checks for UnityEngine.Input.touchSupported in order to allow Unity Remote touch input to work properly when run on an editor platform that does not support touch input.
- Updated SimpleControlRemapping example.
- Updated SimpleCombinedKeyboardMouseRemapping example.

Ah, I understand that. Well, if you ever get crazy bored and decide "what layout to add..." feel free to add DE Thanks anyways.

Click to expand...

I'll add it to the list, but so many of these non-US keyboards are just not really compatible with the limited set of keycodes Unity has. And none of this is going to affect OSX, Linux, Windows UWP, Android, etc. as those platforms use UnityEngine.Input as the input source for all keyboard input unlike Windows which optionally has Raw Input support.

Hello! I just updated to Rewired 1.1.22.0 as I wanted very much the IL2CPP support for Windows Standalone. Upon submitting the updated package using Collab, Unity Cloud Build does report an error on standalonewindows64. FYI, I'm building on both standalonewindows64 and standaloneosxuniversal, and the error is only happening with standalonewindows64 using Always Use Latest 2018.3 option.

Here is the error I am getting:

Code (CSharp):

[Unity] Assets/Externals/Rewired/Internal/Scripts/Misc/ExternalTools.cs(85,20): error CS0234: The type or namespace name 'Windows' does not exist in the namespace'Rewired.Utils.Platforms'(are you missing an assembly reference?)

Any idea why I am getting this issue? I was on Rewired 1.1.21.3 and didn't had this problem. Thanks!

Hello! I just updated to Rewired 1.1.22.0 as I wanted very much the IL2CPP support for Windows Standalone. Upon submitting the updated package using Collab, Unity Cloud Build does report an error on standalonewindows64. FYI, I'm building on both standalonewindows64 and standaloneosxuniversal, and the error is only happening with standalonewindows64 using Always Use Latest 2018.3 option.

Here is the error I am getting:

Code (CSharp):

[Unity] Assets/Externals/Rewired/Internal/Scripts/Misc/ExternalTools.cs(85,20): error CS0234: The type or namespace name 'Windows' does not exist in the namespace'Rewired.Utils.Platforms'(are you missing an assembly reference?)

Any idea why I am getting this issue? I was on Rewired 1.1.21.3 and didn't had this problem. Thanks!

Click to expand...

That would mean that the Windows library is not being loaded. The namespace it's telling you doesn't exist didn't exist in 1.1.21.3. That's all new for 1.1.22.0 and required. That means your libraries you are using are still from the old version while the scripts are from the new version. Delete the entire Rewired folder and reinstall it as described here:http://guavaman.com/projects/rewired/docs/Troubleshooting.html#clean-reinstall

Edit: Argh! Something has broken in the 2017 and 2018 packages and is causing all the platform-specific Standalone libraries to be included on every platform. This was NOT how the meta files were set up. That means this is going to be a problem for anyone downloading this. There's no explanation how these meta files got corrupted/changed, so I have no idea if it will happen again.

go to Rewired/Interal/Libraries/Runtime/

And change the plugin inspector settings on all Rewired_Linux, Rewired_OSX, and Rewired_Windows to only be built on the correct platforms...

Edit: Argh! Something has broken in the 2017 and 2018 packages and is causing all the platform-specific Standalone libraries to be included on every platform. This was NOT how the meta files were set up. That means this is going to be a problem for anyone downloading this. There's no explanation how these meta files got corrupted/changed, so I have no idea if it will happen again.

go to Rewired/Interal/Libraries/Runtime/

And change the plugin inspector settings on all Rewired_Linux, Rewired_OSX, and Rewired_Windows to only be built on the correct platforms...

Click to expand...

I updated to 1.1.22.1 and I'm having the same issue. On my desktop, I can create a build without any problem. However, I do have the same error when using Unity Cloud Build. Could it be that some defines are not set up properly in default Unity Cloud Build by the Unity team? This is really strange. As I said, the same code build is properly built without error with standaloneosxuniversal but I get the following error on standalonewindows64:

[Unity] Assets/Externals/Rewired/Internal/Scripts/Misc/ExternalTools.cs(85,20): error CS0234: The type or namespace name 'Windows' does not exist in the namespace 'Rewired.Utils.Platforms' (are you missing an assembly reference?)

So, 1.1.22.1 works fine locally on standalonewindows64 but fails on Unity Cloud Build.

I updated to 1.1.22.1 and I'm having the same issue. On my desktop, I can create a build without any problem. However, I do have the same error when using Unity Cloud Build. Could it be that some defines are not set up properly in default Unity Cloud Build by the Unity team? This is really strange. As I said, the same code build is properly built without error with standaloneosxuniversal but I get the following error on standalonewindows64:

[Unity] Assets/Externals/Rewired/Internal/Scripts/Misc/ExternalTools.cs(85,20): error CS0234: The type or namespace name 'Windows' does not exist in the namespace 'Rewired.Utils.Platforms' (are you missing an assembly reference?)

So, 1.1.22.1 works fine locally on standalonewindows64 but fails on Unity Cloud Build.

Click to expand...

If you look at the source code where it's throwing the error you will see this:

Code (csharp):

#if UNITY_STANDALONE_WIN || (UNITY_EDITOR && UNITY_EDITOR_WIN)

return Rewired.Utils.Platforms.Windows.Main.GetPlatformInitializer();

That means Unity Cloud Build is enabling the flags that tell scripts this is the Windows Standalone platform.

The namespace it is complaining about "Rewired.Utils.Platforms.Windows" is included in the Rewired_Windows.dll. That would clearly indicate that Unity Cloud Build is setting the Windows Standalone flags but NOT importing the Rewired_Windows.dll that is set explicitly to be included on Editor and Standalone in Windows. I can not imagine this being anything other than a Unity Cloud Build or version control error and I don't see any way possible I can make it work. I don't have the ability to force a DLL to load. All I can do is set the settings in the inspector. Unity has to do the rest. This would also happen if your version control did not copy the new DLLs to the repository.

As I explained here, 1.1.22.0 shipped with corrupted meta files on the Rewired_Windows.dll, Rewired_OSX.dll, and Rewired_Linux.dll causing them to be included on all Standalone platforms. In order to prevent the OSX and Linux DLLs from being included in a Windows build and opposite, each DLL must have its inspector settings changed so it is only included on the corresponding Standalone platform. Did you do this? There's no reason this would cause the Cloud Build error because there's nothing illegal about including OSX and Linux libraries in a Windows build (there are no overlapping classes), but it does waste space in the build.

In order to prevent the OSX and Linux DLLs from being included in a Windows build and opposite, each DLL must have its inspector settings changed so it is only included on the corresponding Standalone platform. Did you do this? There's no reason this would cause the Cloud Build error because there's nothing illegal about including OSX and Linux libraries in a Windows build (there are no overlapping classes), but it does waste space in the build.

Click to expand...

Yes I did this before even upgrading to the latest version (1.1.22.1). I will to yet another clean install and see if I still get the issue with the latest. Otherwise, I will poke the Cloud Build team about this.

Facing the same issue with 1.1.22.1. Tried doing clean install twice (including restarting Unity after deleting Rewired, then again after re-import). Still getting

ExternalTools.cs(85,20): error CS0234: The type or namespace name 'Windows' does not exist in the namespace 'Rewired.Utils.Platforms' (are you missing an assembly reference?)

both locally and in Cloud Build logs. MacOS target is fine, problem is only with Windows target. Checked the rewired libraries — platform assignments are correct. Unchecked, rechecked proper platforms, reapplied, restarted Unity — same error. Switching back to MacOS — all good. Back to Windows — error again.

Unity 2018.3.2f1
Rewired 1.1.22.1

Click to expand...

This can only be a Unity bug. I don't see anything I can do about it. It likely has something to do with Unity's selective DLL include process. Unity's going to have to be notified. Thanks for confirming it.

I am updating rewired from 1.1.21.3 to the latest. I'm seeing some files, namely the ControlMapper.cs and related prefabs that are being overriden during the update. In the import selection dialog, I don't see anything obvious I've selected that would cause this to happen.

j

j
j

I'm trying to figure out how to avoid this from happening as the ControlMapper.cs and prefabs have been customized at our end.
Thanks.

I am updating rewired from 1.1.21.3 to the latest. I'm seeing some files, namely the ControlMapper.cs and related prefabs that are being overriden during the update. In the import selection dialog, I don't see anything obvious I've selected that would cause this to happen.

I'm trying to figure out how to avoid this from happening as the ControlMapper.cs and prefabs have been customized at our end.
Thanks.

Click to expand...

Control Mapper is updated by the editor script every time Rewired is updated. Control Mapper is not included in the Unitypackage base files. It is added as an option on installation. Once installed, the installer knows its installed and will updated it every time Rewired is updated by unzipping the Control Mapper zip package over the existing files.

It is a bad idea to edit the original scripts (or prefabs) that come with Rewired (or any asset) for this reason. You should always make a copy of the scripts you want to modify, change the class name, move them outside the Rewired folder, and delete all the meta files so Unity can generate new file GUIDs.

In this specific case, detection of Control Mapper being installed is done by file path. Simply moving the entire ControlMapper folder outside Rewired/Extras would make the installer think it's not installed and it would not overwrite it when you update Rewired.

Yes, and the error appears even before attempting a build, it's always there in the editor console when Windows is the active build target.

Click to expand...

This problem is definitely not present without the use of ASMDEF files in a fresh project.

If you have an ASMDEF file in any location above the Rewired folder, all scripts in the Rewired folder will be compiled into that assembly, not Assembly-csharp.dll. Therefore, that assembly will have to have references to Rewired_Windows.dll, Rewired_Linux.dll, and Rewired_OSX.dll or else it will not find those libraries and you will see errors like you're seeing. If the assembly that Rewired's ExternalTools.cs file is being compiled to does not have a reference to Rewired_Windows.dll, it will not be able to find the namespace or classes it's looking for and you would see this message.

This problem is definitely not present without the use of ASMDEF files in a fresh project.

Click to expand...

We don't have any parent ASMDEFs. I perfectly understand the consequences, that's why the only ASMDEFs we have are those already included in third-party assets by their respective developers. Right now I've reverted to 1.1.20.0 and it works fine (Windows & MacOS both Cloud Build and local).

Also, when I was attempting second reinstall of Rewired today, I've left it in the root of the project, instead of /Extensions/ folder that we normally use for third-party assets, but that didn't help.

I will try to reproduce in a fresh project, will report if I have any results.

We don't have any parent ASMDEFs. I perfectly understand the consequences, that's why the only ASMDEFs we have are those already included in third-party assets by their respective developers. Right now I've reverted to 1.1.20.0 and it works fine (Windows & MacOS both Cloud Build and local).

Also, when I was attempting second reinstall of Rewired today, I've left it in the root of the project, instead of /Extensions/ folder that we normally use for third-party assets, but that didn't help.

I will try to reproduce in a fresh project, will report if I have any results.

Click to expand...

Does your Rewired/Internal/Libraries/Runtime folder happen to include both the following files:
Rewired_Windows_Lib.dll
Rewired_Windows.dll

The first file is from the old pre-IL2CPP-compatible system. The 2nd file is from the new system. The old file should be deleted by Rewired when upgraded to 1.1.22.0. If the _Lib file exists, delete it. If the Rewired_Windows.dll file isn't there, the package did not import correctly.

Oops...

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.