Search Unity

Rewired - Advanced Input for Unity

Discussion in 'Assets and Asset Store' started by guavaman, Sep 25, 2014.

  1. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    Only on Windows:
    https://guavaman.com/projects/rewired/docs/RewiredEditor.html#Settings

    Native Mouse Handling = TRUE
    Native Keyboard Handling = TRUE
    Ignore Input When App Not In Focus = FALSE
    Application.runInBackground = TRUE

    Do not buy it until you test everything you want to do using the trial version.
     
    Discmage likes this.
  2. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    You cannot swap maps between two different controllers. Open VR Controller Left and Right are two completely different unrelated controllers with incompatible controller maps. Use Layouts.
     
  3. GenericJoe

    GenericJoe

    Joined:
    Apr 27, 2012
    Posts:
    33
    OK, fair enough I will look into this. Thank you.
     
  4. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    This is only my speculation so far, but just wanted to get some opinion on performance difference between Mono and IL2CPP build on Windows while using Rewired.

    My project runs slightly slower using IL2CPP than Mono while using Rewired, and I want to find out if there is any particular reason for this. My game is turn based game, so most of the time, the game is just sitting and doing just rendering and waiting for an input. My initial search result in the Unity being slow on interface calls, so I was wondering if Rewired gets hampered by such "issue" from IL2CPP virtual call issue.

    (https://forum.unity.com/threads/il2cpp-super-slow-vs-mono-standalone.932499/)

    Any idea?
     
  5. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    I can't tell you what might be happening if it's running slower. I have not profiled IL2CPP vs Mono so I can't even verify that's the case with just Rewired running and not a bunch of other code running at the same time that might instead be causing the issue. I'm not an expert on the in's and out's of IL2CPP and I haven't "optimized" (rewritten everything) specifically for IL2CPP based on whatever idiosyncrasies that might have been discovered up to this point. And I would add, doing so would probably be foolish since it's been my experience in the past that such optimizations are fruitless because each platform may be implemented differently, and their implementations of everything are prone to change at any time, just like was the case with all the different flavors of Mono they used across all the platforms.

    Rewired uses some interfaces, yes. So if that's an issue, it's going to be affected. There are probably countless other possibilities. I discovered a big performance issue myself with the lock / Monitor.Enter/Exit mechanism, though that wouldn't affect Rewired much.
     
  6. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    My very basic test profiling the default EightPlayers demo scene on Windows in Mono and Il2CPP in Unity 2020.1.0f1 shows virtually identical performance between Mono and IL2CPP. If anything, IL2CPP may be ever so slightly faster as it seems to show fewer random spikes. Frame to frame, they're basically exactly the same. 0.03 - 0.1 ms.
     
  7. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Interesting. Thanks for the input. I may have to dig deeper, but seriously, I do agree with you on the other post that there should be deeper scripting knowledge base document on what to and not to for IL2CPP since Unity is saying IL2CPP will ( if not already ) be the future where Unity is heading to.
     
  8. dragonBRP

    dragonBRP

    Joined:
    Jul 6, 2017
    Posts:
    3
    Hello I need some advice / help. In our project we use a networking library called mirrorng. Recent changes to core libray trying to use a new special ILProcessor by unity. For some reason it breaks rewired. I have been in close contact with the developers and we tried to fix and narrow down the cause.

    But because your dll are closed off we cannot figure out the issue. I was wondering if it would be possible to work with the mirrorng dev team and give them some insight as what could cause your 2 dll to break specifically Rewired_Editor.dll and Rewired_Core.dll. I will post the error but first off let me say that its the same error u saw in 2019.2 which caused you grief and I have done lots of searches and even saw all your posts suggestion that its only cosmetic. In this instant it really is not cosmetic and 100% breaks your dll's. Below are the errors. This is only happening now in newer versions of mirrorng as they are testing out a new weaving system for there networking library. My guess your dll's have memory temper proof stuff and only thing I can think of is ILProcessor does something in memory and triggers it and breaks it I dont know really, atm its total mystery to me and the mirrorng dev team. We did intensive testing and even put blocks in where we thought it might be causing issues and it still breaks.

    Any help with this issue would be greatly appreciated.

    https://github.com/MirrorNG/MirrorNG

    Link to there source code if you want to run some tests. Any new blank project will break.

    Code (CSharp):
    1. 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:<unknown type> member:(null) signature:<none>
    Code (CSharp):
    1. Unloading broken assembly Assets/Rewired/Internal/Libraries/Runtime/Rewired_Core.dll, this assembly can cause crashes in the runtime
    2.  
    3. Unloading broken assembly Assets/Rewired/Internal/Libraries/Editor/Rewired_Editor.dll, this assembly can cause crashes in the runtime
    4.  
     
    Lymdun likes this.
  9. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    767
    To add some context, It looks like rewrired shows these errors with any ILPostProcessor. The upcoming MLAPI from Unity will also be based on ILPostProcessor. I even modified our post-processor to do nothing at all and it still caused this error.
     
    Lymdun likes this.
  10. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    What is happening here is completely out of my control. Rewired isn't doing anything at all to cause this other than having a reference to the UnityEngine.UI library. This has nothing to do with any kind of exotic code in Rewired. The error it shows even shows as much:

    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:<unknown type> member:(null) signature:<none>

    This is a Unity linker issue. They're responsible for linking the correct libraries when making builds. After all their changes breaking Unity UI out into the package manager, they did a bunch of under-the-hood work to get these libraries linked for DLLs that reference them (with lingering flaws like the cosmetic error), but they've clearly not done the same for this new ILPostProcessor system.

    There's nothing I can do to make this work. I suggest you contact Unity about this. This isn't specific to Rewired. The problem will happen with any DLL that references the UnityEngine.UI DLL or likely any other package manager DLL.
     
    Last edited: Jan 19, 2021
  11. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    @dragonBRP

    According to this:

    I would question why the mirroring library you're using chose to use an undocumented, unsupported, internal Unity feature.
     
  12. dragonBRP

    dragonBRP

    Joined:
    Jul 6, 2017
    Posts:
    3
    While i understand there maybe nothing you can do or maybe you can. The fact remains your asset is the only one that breaks. I can guartantee i have other assets in our project that references that unity ui and there compiled dlls. Procedural world is one of them. I was just hoping maybe you could take a peak and see something easy to fix. If dll was not scrambled i would not bug ya and fix myself. But it is and 100 percent understand why and understand why u cant or dont want to release source but i cant fix it and im sure more users soon will be chiming in. I know of a few who use rewired and use mirrorng i just spoke up for them.
     
  13. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    This has nothing to do with me not wanting to release a workaround. If is possible to fix, I will. If there are other assets that reference Unity UI from a DLL and don't break, that's odd. I never saw any resolution to this linking issue in the long thread discussing it when it first came up. There were posts by Unity employees acknowledging the problem with DLL's, but no resolution or instructions on how to avoid the issue was ever posted that I saw. There is nothing I know of that I can do any differently to reference a DLL than I am doing. A reference is a reference. If you have some kind of other information to the contrary, let me know.

    The specific function referenced in the error is GenerateInteractableAnimatorContoller which includes UnityEngine.UI.AnimationTriggers and UnityEditor.Animations.AnimatorController in the function signature. It's possible it has something to do with one or both of these classes which should be included by referencing. Those are only in the editor DLL and not in the main DLL though so that's unlikely to be the only issue. It may simply be I'm referencing classes or functions that the other plugins you're using don't happen to reference.

    Have you contacted Unity about this?

    I will look at Mirror and see what I can find.

    Edit: I can see it spitting out the same error that you posted, but I see nothing else to possibly go on to figure out why except the Unity UI error.
     
    Last edited: Jan 20, 2021
  14. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    Can you check the DLL in ILSpy or something and verify that it actually references Unity UI? There may be other scripts included that are referencing it instead. I would be interested to know if the DLL is actually referencing it.
     
  15. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    @dragonBRP

    I spent the time to strip out all Unity UI classes and functions and removed the DLL references from both Rewired_Core.dll and Rewired_Editor.dll. Problem gone.

    This issue is exactly what I said it was and I have no idea how to fix it because it's really not a bug but an artifact of all the juggling Unity did to move Unity UI to the package manager. Something is wrong with the linking of UnityEngine.UI.dll. I don't know anything about ILPostProcessor, but I suspect whatever the MirrorNG / UniTask / Cecil stack is doing with regard to the assemblies does not replicate Unity's linking patch up job they must have done to get these assemblies linking again after the package manager change. I don't see how this could possibly only affect Rewired unless Rewired's the only program that comes with a DLL that links to Unity UI.

    I don't see any way I could fix this short of making some kind of binding/wrapper layer for all the Unity UI functions and classes that exists in CS scripts and use interfaces defined in the DLL to remove the references to Unity UI entirely. That may not even work as there are likely some classes defined in the DLL that inherit from classes in Unity UI and/or expose Unity UI objects in inspector fields of MonoBehaviours already.

    Unity is definitely going to have to get involved here for us to understand what is going on and if there is any way around it.
     
    Last edited: Jan 20, 2021
  16. GenericJoe

    GenericJoe

    Joined:
    Apr 27, 2012
    Posts:
    33
    OK, I think I'm nearly there, but could you advise on an issue I have where the layoutManager.ruleSets are appearing to be empty during runtime?
    I have created two rulesets like so:



    I then want to toggle between the "Default" and "Leftie" layouts like so:
    Code (CSharp):
    1.         player.controllers.maps.layoutManager.ruleSets.Find(item => item.tag == "Default").enabled = !LeftHanded;
    2.  
    3.         player.controllers.maps.layoutManager.ruleSets.Find(item => item.tag == "Leftie").enabled = LeftHanded;
    4.  
    5.         player.controllers.maps.layoutManager.Apply();
    However this throws an exception, and on debug inspection it appears the layoutManager.ruleSets are empty lists. Have I forgotten something?
    Thanks in advance for any help/advise.
     
  17. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    Rules and rule sets exist per-player just like Controller Maps and therefore have to be added to the Player to be used. See the documentation:

    https://guavaman.com/projects/rewired/docs/LayoutManager.html

    Creating Rule Sets in the Rewired Editor:

    Rule Sets can be created in the Rewired Editor on the Layout Manager Rules page. After creating the Rule Sets, you must assign them to Players on the Players page or they will not be used.
     
  18. GenericJoe

    GenericJoe

    Joined:
    Apr 27, 2012
    Posts:
    33
    Ah, sorry - I missed the "assign them to Players on the Players page". That's fixed it- thank you!
     
  19. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    767
    Thank you for looking into this. I was also digging into why this is happening. This is what I found:

    As soon as ILPostProcessor changes any assembly, it triggers a "Begin MonoManager ReloadAssembly". This process will reload your DLLs. The problem is that your DLL libraries are reloaded _before_ unity has a chance to build the source packages including Unity UI. So when your DLL libraries are reloaded, UnityEngine.UI.dll has not been built yet, and your DDLs error out.

    This would not happen in earlier versions of unity because unity came with UnityEngine.UI.dll pre-built, so it always existed when your DLLs are loaded.

    We found a temporary workaround: copy UnityEngine.UI.dll in the project so your DLLs can find it when they are reloaded.

    You will have this issue when MLAPI is released, or any other library that uses ILPostProcessor. You can think of this as an early warning. When unity gets its multiplayer library released, you will start getting lots of bug reports about this.

    Bottom line: your DLLs cannot have reference to source packages (including UnityEngine.UI.dll).

    My suggestion would be to put the parts that reference unity UI in source files instead of pre-built DLLs and have your UI independent logic in the DLLs
     
    Last edited: Jan 23, 2021
  20. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    Thanks for the information.

    There is a reason I didn't pull all the Unity UI content out of Rewired years ago when they made this change. Pulling out all the Unity UI dependent classes from the DLL will cause mass breakage of every project that uses Rewired. Unity handles MonoBehaviours inside DLLs and compiled by Unity differently, so moving these classes outside the DLL will lead to broken script references of any UI-related content (touch controls, etc.)

    It seems to me like MonoManager ReloadAssembly could be changed to build the Package Manager packages before importing the DLLs in the project. Clearly Unity already made changes to deal with this after they moved UI to the package manager in order to prevent packages with Unity UI assembly references from breaking. Sometimes the cosmetic error still shows up like when upgrading a project due to hiccups in order of compilation / linking, but in general it has worked.

    Unity needs to be made aware of this. If they don't implement something to handle compilation order differently, then they need to put some information out there that says no DLL is ever allowed to have any dependency on Package Manager managed assets.

    Edit: I've contacted someone at Unity about this and will follow up here with any information I find out.
     
    Last edited: Jan 24, 2021
    Lymdun and goldbug like this.
  21. doublehitgames

    doublehitgames

    Joined:
    Mar 5, 2016
    Posts:
    97
    I'm just going to leave my congratulations to the developer. First I apologize for making a hasty comment in the reviews. I have already modified my rating.

    When I introduced Rewired to my game, it was already finished, so I had more difficulty than just when we started something in the beginning.

    I couldn't use the example as a standard in my game because it requires some peculiarities. But as a developer I was really happy to see how well it went. I had a lot of freedom to program my own remap system. Existing examples and documentation helped me. I needed only 1 support to reach my goals. Therefore. My congratulations, and thanks for this asset.



    Joystick remap:



    Keyboard.





    PS: I would be happy to be on your completed game cases, if you wish to include.
    https://www.eternalhopegame.com/

    Currently the game are in Steam but, soon at Xbox-One, NintendoSwitch, Android and IOS.
    Every with Rewired (^.^)
     
    Last edited: Jan 24, 2021
  22. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    @doublehitgames2

    I'm glad you were able to figure it out and get it working. And thanks for the review!
     
  23. Bobane

    Bobane

    Joined:
    May 13, 2014
    Posts:
    8
    Hi, thank you for the active support.

    When trying to update the Nintendo Rewired Plugin, the download "starts" but gets immediately stuck and remains so.
    Clicking on cancel results in Unity being perma stuck and a restart is needed.
    This issue happens to multiple people working on the same project from different machines.

    Our studio is not the original studio that bought the license and is not the studio that requested the Nintendo Tool Authorization for Rewired, however, we have purchased a license of our own and can update the main package of Rewired with no issues.

    Could Nintendo authorization be the issue here? I've put in a request but was wondering if this is a known issue as I seem to remember being able to update the Nintendo plugin before.

    Thanks!
     
  24. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    No. There is no authorization of any kind taking place when trying to use the in-editor plugin updater.

    You are probably trying to update a very old version of the plugin. That is a long-standing issue that will never be resolved because of breakages due to different .Net runtimes being used by Unity. Download it from the original download link. If you don't have that, register for the plugin through the Nintendo Developer Portal.
     
  25. Bobane

    Bobane

    Joined:
    May 13, 2014
    Posts:
    8
    Will do that, thank you for the response :)
     
  26. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    315
    When ButtonDoublePressJustReleased fires, ButtonSinglePressJustReleased also fires. This is a problem in my game since single press selects only that unit, while double press selects all units of a type. So what ends up happening is it selects all units of that type then selects only a single unit, undoing ButtonDoublePressJustReleased . How do I fix this?
     
  27. DTAli

    DTAli

    Joined:
    Jan 22, 2016
    Posts:
    54
    Hi @guavaman , I'm getting build errors upgrading to the 1.1.38.1 version about Nintendo Switch,

    Code (csharp):
    1.  
    2. Assets\Rewired\Plugins\NintendoSwitch\Scripts\NintendoSwitchInputManager.cs(145,38): error CS0539: 'NintendoSwitchInputManager.Initialize(Platform, ConfigVars)' in explicit interface declaration is not a member of interface
    3.  
    I'm not sure if we need to download some Rewired sdk from Nintendo's website or I'm missing something else?

    Changing the argument type to 'object' solves the error, but wasn't sure if that's the best fix.
     
  28. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    Don't change anything on compiler errors like this.

    It means the plugin version you're using is outdated and has to be updated. Plugins rely on data in the core. If something material changes in Core that affects the plugin, the plugin will break. It's rare that anything in Core changes that affects the plugins, but it can and there's no way to show you some kind of nice message telling you what to do because the compiler can't even finish compiling.
     
  29. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    I just went through and tested every permutation of Single and Double press I could think of including polling and input events. There is only one possible scenario where you could be getting this result.

    If you are setting your own timing override on the DoublePress functions to change the timing, you can't use Single press and have it work correctly.

    The function overloads of GetButtonDoublePressDown/Up ignore the InputBehavior settings for double press speed and allow you to use your own custom speed value inline. However, GetButtonSinglePressDown/Up do not have an option that lets you set an inline speed and will always use the InputBehavior speed.

    https://guavaman.com/projects/rewir...M_Rewired_Player_GetButtonSinglePressDown.htm

    "Gets the button just single pressed and held state of an Action. This will return TRUE for only the first frame after a button press and after the double press timeout has expired. This will never return TRUE if a double press occurs. This method is delayed because it only returns TRUE after the double press timeout has expired. Only use this method if you need to check for both a single press and a double press on the same Action. Otherwise, use GetButtonDown instead for instantaneous button press detection. The double press speed is set in the InputBehavior assigned to the Action."

    (Note the word "and" in "after a button press and after the double..." could be misleading. It needs to be reworded. It does not fire twice. It fires once, after the timeout has expired.)

    As you can see from that description, Single Press is dependent on Double Press because Single Press will only fire if Double Press's timeout has already expired. By using your own Double Press time override inline, your Single Press functions are still working on the Double Press timeout defined in the InputBehavior while your Double Press is working on its own timer. Therefore, it's possible for Single Press to during or after Double Press has fired, which would not be possible if you were not using the inline speed overload of Double Press.

    If you want a long double press timeout, you can't use Single Press because it will make a single press too unresponsive. In that case, you won't be able to achieve this game logic using shortcuts and will have to design your unit to respond to input differently, watching for the desired input patterns in code instead of using these convenience functions.

    Or, you could just check in code for DoublePressUp before SinglePressUp and ignore SinglePressUp if DoublePressUp returns. You are using events, but you can always check the InputEventData for other values in the event. But in that case, you might as well just use GetButtonDown/Up since it is even more responsive than SinglePress, returning instantly, and just ignore it's up event if fired on the same frame as DoublePressUp.
     
    Last edited: Jan 27, 2021
  30. DTAli

    DTAli

    Joined:
    Jan 22, 2016
    Posts:
    54
    OK so I went into the Nintendo site and searched for Rewired, found the page. There's a verification/request thing at the bottom that I filled out and sent, do I just wait for a download link now or how does that work?

    Thanks
     
  31. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    Please wait for me to get the email, process it, then send you download instructions. This is a manual process.
     
    DTAli likes this.
  32. DTAli

    DTAli

    Joined:
    Jan 22, 2016
    Posts:
    54
    Thanks, all good. Just wasn't sure what the process was. An ex-employee did the current version and it wasn't documented anywhere.
     
  33. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Hello @guavaman

    i'm having issues with control remapper. For example, i change the right action from right arrow to something else (for example, H, like on the image). When i want to remap it back to right arrow i get a conflict. I use arrows for UIHorizontal, UIVertical via separate map but no other assignments are made for those.

    UI Action Categories are not visible in lists
    UI Map Category has user assignable unchecked
     
    Last edited: Jan 29, 2021
  34. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    Sounds like you didn't set up conflict checking rules:
    https://guavaman.com/projects/rewired/docs/ControlMapper.html#conflict-checking

    Setting a Map Category to not user assignable does not tell it what categories should be checked against each other.
     
  35. Blitz54

    Blitz54

    Joined:
    Dec 20, 2020
    Posts:
    20
    Hello! Firstly, thank you for making Rewired and being so active in this forum. Rewired is my first Unity Asset purchase, and it's made life quiet a lot easier.

    Few questions though, I have an old controller, a Microsoft SideWinder Game Pad USB. Unfortunately it's not recognized by Rewired, which I didn't really expect it to be. You do have the joystick SideWinder's with limited functionality according to the documentation, but no Game Pad.

    I finally found your guide for adding a new template myself, but if I do that, would I be able to provide you with the file so you can add native support? It's not really worth it to mail the controller as it's pretty unlikely someone would be using one, but if I can set up the template following your guide, I'd gladly lend a hand that way.

    Thanks!
     
  36. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    315
    https://guavaman.com/projects/rewired/docs/ControlMapper.html
    "Translating strings of Rewired objects"
    Seems to be out of date. For example, it says "modify all the functions below the line that reads "// Translation of Rewired core items" to translate the elements" however this comment doesn't exist in any source file in my project.

    To clarify what I need to do to LanguageData.cs
    1. Subclass LanguageData
    2. Override yes, no, add, replace, move and so on
    3. What do I do for Descriptive name, Positive name, negative name?
     
  37. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    It's not out of date. If you don't see that in LanguageData.cs, you are using a very old version of Rewired and you need to update.

    >> 1. Subclass LanguageData

    This is explained in the documentation you linked:

    "In order to implement translation of these elements, you will have to override the LanguageDataBase class and extend it in order to plug in your translation and override each function pertaining to translation of Rewired core item names. Copy LanguageData.cs to a location outside the Rewired folder hierarchy, rename it to something else, change the class name to match, and modify all the functions below the line that reads "// Translation of Rewired core items" to translate the elements you want to translate using whatever lookup system you have set up for that. You will then have to make a ScriptableObject instance of your new extended class, then attach that to Control Mapper in the inspector so it uses it instead of the default language object."

    >> 2. Override yes, no, add, replace, move and so on

    Editing the language:

    Edit the language file in the inspector. There is no user-friendly inspector for this language editing process, but the names of the fields should be self-explanatory. Make your changes and they will show up when you launch the game. (Language setting changes can not be viewed in real-time in the editor.)

    >> 3. What do I do for Descriptive name, Positive name, negative name?[/QUOTE]

    Change the source code of the various functions that handle translating Action names, controller element names, etc., in the copy of LanguageData.cs you made.
     
  38. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    Thanks. I'm glad you like it.

    Thanks for the offer, but I generally do not add mappings that only cover one platform. When I map a controller, I have to map it across all platforms it works with times the number of input sources available for use on that platform. Apart from that, I'm not looking to add controller definitions for old, rare controllers. Every controller definition I add slows down editor Play mode for everybody because of the serialization system and the amount of data that has to be unloaded and loaded by the editor each time, so it doesn't make sense for me to add any more 20+ year old controllers.

    Controllers don't have to be recognized to work:
    https://guavaman.com/projects/rewired/docs/SupportedControllers.html#controllers-without-definitions
     
    Blitz54 likes this.
  39. Blitz54

    Blitz54

    Joined:
    Dec 20, 2020
    Posts:
    20
    Ah it's unfortunate that it slows down play mode. I did set up the unknown controller, but if I set the bindings to work nicely with my SideWinder, then I'm sure it will make more standard controllers be mapped worse.

    It was a thought. Thanks again though!

    EDIT: Of course I can add the option to remap controllers, which I'll have to do eventually, I was just aiming for straight plug in support since I had this awkward controller kicking around.
     
    Last edited: Feb 1, 2021
  40. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    That was my point. You always need a way for users to remap controls as explained in the Best Practices:
    https://guavaman.com/projects/rewired/docs/BestPractices.html

    If you release a game on desktop platforms without it, you're going to have lots of support nightmares.

    The Unknown Controller map is best not tailored to a specific controller. Some advice on this in Controller Maps.
     
  41. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,089
    Hi,

    I recently upgraded to a more recent Unity build (2020.2.2.f1). I also updated Rewired to the latest version (1.1.38.2). However, when I run the game I still get this error:

    Rewired: The version of Rewired installed (1.1.38.2.U2019) was not designed for Unity 2020. Please install Rewired for Unity 2020.

    Is there a more recent version of Rewired designed for Unity 2020? When I open the Rewired Editor it says the version is '1.1.38.2.U2019'.

    Thanks for any help.
     
  42. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    See the documentation:
    https://guavaman.com/projects/rewired/docs/Troubleshooting.html#wrong-rewired-version-installed
     
    tonemcbride likes this.
  43. diesoftgames

    diesoftgames

    Joined:
    Nov 27, 2018
    Posts:
    122
    This isn't working for me on macOS. It is retaining the cache somehow/somewhere. I noticed that you direct us to `~/Library/Unity/Asset Store` in the linked documentation, but at least for me, that directory only caches images for the packages. I've somehow got 1.1.35.3U2019 cached somewhere and I can't seem to shake it.

    Okay just indiscriminately deleting `~/Library/Unity/Asset Store`, `~/Library/Unity/Asset Store-5.x` and `~/Library/Unity/cache` seemed to do the trick.
     
  44. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    My documentation isn't always current with Unity. Check Unity's documentation for the right folders. I've been doing this 6.5 years and support versions of Unity from 4.3. Anything in my docs that refers to someone else's product (Unity, Steam, etc.) is not authoritative. It's a battle between "Do I document it here and somehow have to maintain it forever or just tell them to go see the other product's docs." There is no good option.
     
    Last edited: Feb 2, 2021
  45. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
  46. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
  47. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    Ok thanks!

    [ UPDATE 1 ]
    I did the same test with my xbox one controller. Still got the same GUID. I'm not sure what I'm doing wrong. I don't have a 360 controller. :confused:
    • d74a350e-fe8b-4e9e-bbcd-efff16d34115
    I also tried running this prior to GetLastActiveController()
    Code (CSharp):
    1. Rewired.ReInput.players.GetPlayer(0).controllers.ClearLastActiveControllerChangedDelegates();
    [ /UPDATE 1 ]

    Also I have another question. I've got the
    • 8Bitdo SN30/SF30 Pro 8Bitdo SN30 Pro 6d33fb97-9b0b-4100-a015-668acb50eeeb
    plugged in.

    I should note it's the SN30 PRO + not sure if the + does anything.

    But when I run
    Code (CSharp):
    1.     void Test()
    2.     {
    3.         print("Rewired.ReInput.players.GetPlayer(0).controllers.GetLastActiveController() " + Rewired.ReInput.players.GetPlayer(0).controllers.GetLastActiveController().hardwareTypeGuid);
    4.     }
    I get this message
    Rewired.ReInput.players.GetPlayer(0).controllers.GetLastActiveController() d74a350e-fe8b-4e9e-bbcd-efff16d34115


    Which is for
    • Xbox 360 Controller Xbox 360 Controller d74a350e-fe8b-4e9e-bbcd-efff16d34115
    Do you know what I'm doing wrong? I tried turning on\off the controller, but still get the same GUID. :eek:
     
    Last edited: Feb 3, 2021
  48. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    Your 8Bitdo controller has many connection modes. The mode you are using emulates an XInput device.
     
  49. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    I see. Ok good to know. Thanks!
     
  50. Meowx

    Meowx

    Joined:
    Oct 10, 2015
    Posts:
    33
    Sorry for the gravedigging; this code had been serving me well but how would I modify it so it ignores mouse movement? Aka any button press/mouse click still cancels the timeout but just moving the mouse doesn't.