Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Rewired - Advanced Input for Unity

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

  1. Silvermurk

    Silvermurk

    Joined:
    Apr 29, 2016
    Posts:
    162
    Can you point me to a page in manual where there is some code snipper to read input from rewired to swith opening menus and inventorys to it ?
    Thanks)
     
  2. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    I don't understand the question. There's no documentation about doing that specific thing with Rewired. You get input from the Player and use it to do whatever you want to. If you are referring to using Unity UI:
    https://guavaman.com/projects/rewired/docs/RewiredStandaloneInputModule.html
     
  3. Silvermurk

    Silvermurk

    Joined:
    Apr 29, 2016
    Posts:
    162
  4. connerfritz

    connerfritz

    Joined:
    Feb 9, 2014
    Posts:
    4
    Hey, I'm having an issue with DirectInput and triggers. Based on everything I've read in the docs, when not using XInput, both triggers work as a single axis, with Left Trigger being -1 and Right Trigger being +1.

    I'm trying to get the negative values from the triggers, but it all seems to exclusively return a range between 0 and +1. Am I misunderstanding how the triggers work and this is normal, or have a terribly misconfigured things resulting in both triggers giving the same 0-1 result?

    Just to be clear, expected behaviour:
    - when holding down left stick, both stick axis = -1
    - when holding down right stick, both stick axis = +1
    Actual behaviour:
    - when holding down left stick, both stick axis = +1
    - when holding down right stick, both stick axis = +1

    EDIT:
    I think I found the problem:
    Using the UnityJoystickElementIdentifier I noticed Axis 2 seems to be the value that should go between -1 and 1, and that was working.

    The issue seems to be in the configuration in: Rewired/Internal/Data/Controllers/HardwareMaps/Joysticks/MicrosoftXboxOne.asset
    under Hardware Joystick Map Editor > Windows Fallback > Axes

    These seem to be flipped, which combined with inversion causes both axes to report the same value.

    Left Trigger > Custom Source Data Entry 0 (for Axis 2)
    > Change Source Axis Range from Positive to Negative
    > Turn Invert On

    Right Trigger > Custom Source Data Entry 0 (for Axis 2)
    > Change Source Axis Range from Negative to Positive
    > Turn Invert Off

    I'm not sure if this config problem exists in other controllers, I'll have to try testing Xbox 360 and other XInput controls.
     
    Last edited: Feb 12, 2020
  5. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    The Windows Fallback definition is not used by Direct Input. That is only used if Native input is disabled. That uses UnityEngine.Input as the input source. If changing the Windows Fallback definition did anything at all, native input is disabled or you have the Primary Input Source set to Unity. This is not advised.

    Second, the controller definitions are made so triggers are normalized from a 0 - 1 range. You should never be able to get a -1 value from a trigger for a recognized controller. Changing a controller definition to disable this standardization is not advised because that's not how Rewired is designed to work and your changes will be overwritten when you update Rewired.

    You are talking about triggers but then state:

    Sticks?

    Any problem you've discovered in any Rewired Windows Fallback controller definition likely means something has changed either in a Windows driver or in Unity. It's not advisable for you to go changing this to work on your system as this may very well be some new error that you're correcting for and may only be specific to your system. There were over 2 years of problems when Windows 10 came out and they kept releasing broken drivers for the Xbox One controller. I went through huge pains to detect and make things work as best as possible for all versions of Windows 10.

    What version of Unity is this?
     
    Last edited: Feb 12, 2020
  6. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    Yep. Another Unity screw up, or less likely, an intentional change. (Edit: Screw up. Happened in 2018.3. Not documented.). They inverted the Axis 2 value at some unknown version of Unity blowing up all the Windows fallback definitions for all XInput-compatible devices (360, One, Logitech F310, F710, Zhidong, etc.). You can see plenty of mappings on the internet that show Right Trigger is supposed to be a negative value and Left Trigger positive:
    https://answers.unity.com/storage/attachments/134371-xbox-one-controller-unity-windows-macos.jpg
    https://ritchielozada.com/2016/01/16/part-11-using-an-xbox-one-controller-with-unity-on-windows-10/

    My testing still shows this is true in older versions of Unity. Now to figure out in which version(s) they did this. Most likely it happened at some point in 2019 and possibly backported to the LTS releases of 2017 or 2018.

    The whole point of the MaxAbsValue system I put in place for these controllers was to get around problems caused by the fact that the Axis 8 and 9 don't always work, especially if using more than 4 XInput devices, only Axis 2 is reliable.
     
    Last edited: Feb 12, 2020
  7. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    Last edited: Feb 12, 2020
  8. connerfritz

    connerfritz

    Joined:
    Feb 9, 2014
    Posts:
    4
    Ah, thank you! I'm on 2019.2 but I think I now realize the core of my mistake was confusing the "Disable Native Input" and "Disable XInput" settings, thought the one meant the other. Definitely don't need to be using Unity Input. Thank you for the clarification.

    Also, thank you for creating a fix for Unity inverting its trigger axis so quickly. I've been using Rewired for years and it's amazing, and the fast turnaround time on issues and updates continues to blow me away. Great work!
     
    guavaman likes this.
  9. vinchkovsky

    vinchkovsky

    Joined:
    Oct 9, 2016
    Posts:
    9
    Hello

    I'm using Dualshock 4 with iOS devices, it's recognized as 'iOS MFi Gamepad' if I'm not wrong.

    I mapped its 'Pause' button to my custom 'Exit' action.

    When I press 'Options' button on my Dualshock 4, my action doesn't work (player.GetButton("Exit") always returns false)

    If I remap this action to any other button (like 'B' element in MFi gamepad which corresponds to Dualshock's Circle button), everything works fine.

    Just checked a few months old build and 'Options' button works as expected. Today I made a very simple demo scene with button press detection, and it doesn't work. Which means the problem is caused not by iOS/gamepad firmware updates.

    Are there any suggestions how can I make 'Pause' element work in 'iOS MFi Gamepad'?

    Unity version is 2018.4.16f1, Rewired was updated just today.

    Thanks in advance
     
  10. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    This is a new Unity bug.

    See this message for discussion:
    https://forum.unity.com/threads/rewired-advanced-input-for-unity.270693/page-118#post-5415174
    https://forum.unity.com/threads/rewired-advanced-input-for-unity.270693/page-118#post-5416953
    https://forum.unity.com/threads/rewired-advanced-input-for-unity.270693/page-118#post-5418177
    https://forum.unity.com/threads/rewired-advanced-input-for-unity.270693/page-118#post-5418222
    https://forum.unity.com/threads/rewired-advanced-input-for-unity.270693/page-118#post-5418231
    https://forum.unity.com/threads/rewired-advanced-input-for-unity.270693/page-118#post-5418282
    https://forum.unity.com/threads/rewired-advanced-input-for-unity.270693/page-118#post-5418303
    https://forum.unity.com/threads/rewired-advanced-input-for-unity.270693/page-118#post-5418333

    See these two 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
     
  11. vinchkovsky

    vinchkovsky

    Joined:
    Oct 9, 2016
    Posts:
    9
  12. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
  13. Steviebops

    Steviebops

    Joined:
    Apr 9, 2013
    Posts:
    104
    Hi, just bought rewired to use with Universal Fighting Engine 2.

    Im getting this error when I try to open the control mapper

    "Rewired Control Mapper: All references must be assigned in the inspector!"

    Could you shed any light on this?
     
  14. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    Did you install the Text Mesh Pro version of Control Mapper? The UFE2 integration that includes Control Mapper integration cannot use the Text Mesh Pro version. It was made long before that existed. You must install the normal Control Mapper to use the UFE2 integration.

    Edit: I have confirmed that you would get that error with the Text Mesh Pro version of Control Mapper installed trying to use it with the UFE2 integration.
     
    Last edited: Feb 14, 2020
    shyamarama and Steviebops like this.
  15. Steviebops

    Steviebops

    Joined:
    Apr 9, 2013
    Posts:
    104
    Will do, thanks!

    [Edit] This solution fixed my problem, for anyone who is interested :)
     
    Last edited: Feb 14, 2020
  16. h0neyfr0g

    h0neyfr0g

    Joined:
    Jul 13, 2019
    Posts:
    17
    Love love love this asset.

    But can someone help me turn off this warning? When I load another scene i know that the duplicate instance is being destroyed, but I would like to not see this error every time.

    Thanks!

    Rewired: Only one Rewired Input Manager may exist in a scene. This additional Rewired Input Manager game object will be deleted. You may see this warning if you are loading a new level that contains a Rewired Input Manager. If that's the case, you can safely ignore this warning. This warning will never be logged in a build.
    UnityEngine.Logger:LogWarning(String, Object)
    Rewired.Logger:LogWarningNow(Object, Boolean)
    Rewired.Logger:LogWarning(Object, Boolean)
    Rewired.Logger:LogWarning(Object)
    Rewired.InputManager_Base:IsOnlyManagerInScene()
    Rewired.InputManager_Base:Initialize()
    Rewired.InputManager_Base:Awake()
     
  17. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    Use a Rewired Initializer to instantiate it instead:
    https://guavaman.com/projects/rewired/docs/InputManager.html
     
  18. Steviebops

    Steviebops

    Joined:
    Apr 9, 2013
    Posts:
    104
    I have dropdowns for setting graphics options in my game, but I cant seem to expand the list with the controller. All the other options, toggles and buttons, work fine with controller input, and if I select the dropdown arrow with the mouse, the controller can navigate it.

    Is this an error on my part, or is Unity UI not playing nice with Rewired?
     
  19. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    This almost certainly has nothing to do with Rewired at all. All UI controls are Unity-side code. They respond to input events that are sent through the event system. The source Input Module creating those events doesn't matter. The controls can't even tell what the source of these events is. The underlying Input Module source doesn't know anything about the controls that are receiving the events. If the object is the selected GameObject in the EventSystem, it will receive the OnSubmit event when you press the button associated with the Submit Action and directional navigation events when you press the element associated with movement. The only part the underlying Input Module has in this is to send these events to the Event System as the user presses buttons. Once the dropdown list opens, the control has to be smart enough process the navigation events to step through the items in the list. This logic is 100% on the dropdown control to handle.

    Try this with the UnityStandaloneInputModule and see if it works. It's only going to work if Unity programmed the dropdown component to work properly with the Selectable navigation system.
     
    Last edited: Feb 16, 2020
    shotoutgames and Steviebops like this.
  20. Steviebops

    Steviebops

    Joined:
    Apr 9, 2013
    Posts:
    104
    Legit seems to be a Unity UI issue, there's a few forum questions about it, and it's never been solved, such a bizarre thing for Unity to overlook imo.
     
  21. Little_Gorilla

    Little_Gorilla

    Joined:
    Oct 11, 2013
    Posts:
    98
    Is there any way to calibrate the axis of an action? Or to find the axis that corresponds to an action?

    I've been searching on this forum and the internet but can't seem to find anything.

    In my case it's a racing game where the player can remap all buttons and I want them to be able to set the deadzone for say the steering whether it's on the left thumbstick or right thumbstick.

    In the ControlRemapping1 demo they're hard set to the joystick axis.

    upload_2020-2-18_11-24-5.png
     
  22. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    Actions cannot be calibrated. The underlying joystick axis is what is calibrated and the Action is calculated from all the bound controller elements. If you were to calibrate an Action and not the axis, you'd have to re-calibrate it every time you changed axis assignments or joysticks because calibration is inherently dependent on the properties of hardware underneath.

    ControlRemapping1 is correct. Each axis on each joystick has its own calibration settings. This UI is simply showing you what axes exist on the joystick and what can be calibrated. Calibration affects the axis and thereby any and all Actions that are bound to that axis. The user is presented with a list of joystick axes to calibrate, not Actions, for this reason. The user calibrates the axis once and that calibration follows it regardless of which Action(s) they decide to bind the axis to.

    The relationship between the controller element and Action is the core of the Action mapping system and the reason ActionElementMap (binding) exists:

    https://guavaman.com/projects/rewired/docs/api-reference/html/T_Rewired_ActionElementMap.htm
    https://guavaman.com/projects/rewir...l/P_Rewired_ActionElementMap_elementIndex.htm
    https://guavaman.com/projects/rewir...ml/P_Rewired_ActionElementMap_elementType.htm

    I do not recommend you conflate the Action with the underlying axis. A user should not be calibrating an Action in attempt to hide the construct of separate controller elements and Actions. This will cause you all kinds of problems such as the user being unable to calibrate an axis before first assigning it to an Action. The controller they're using may have such poorly-calibrated axes that they can't even assign the axis before calibration because the range of the axis defaults to too small a range to be detected. This very issue came up within the last 2 weeks on this thread with another developer making a game for RC controllers. In addition, one Action may have any number axes bound to it, and each of those axes must be able to be calibrated. If you try to make it appear the user is calibrating the Action, they will be limited to binding only one axis to that Action.
     
    Last edited: Feb 18, 2020
    Little_Gorilla likes this.
  23. Little_Gorilla

    Little_Gorilla

    Joined:
    Oct 11, 2013
    Posts:
    98
    I totally understand and thank you for the thorough explanation!!

    To get around this, this should work for my needs I think, apologies if it's going against all the paradigms!

    upload_2020-2-19_9-21-18.png
     
  24. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    455
    Hello guys,

    I was just wondering, how do I map a key without Inputmapper?

    so, instead of initializing inputmapper for the player poll, I just want to assign a key through script.



    Also, another question
    regarding UserDataStore_playerPrefs, how do I return settings to default? is there an API for it other than Save and Load?
     
    Last edited: Feb 20, 2020
  25. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    Create or change the Action Element Map. This is a binding.

    Create or replace Action Element Map in the Controller Map.

    Read the documentation on Controller Map to understand the structure of the mapping system:
    https://guavaman.com/projects/rewired/docs/ControllerMaps.html

    All Player functions are presented categorized by type in the helper objects in Player. Each helper object contains the complete API for a specific topic:

    https://guavaman.com/projects/rewired/docs/HowTos.html#important-classes

    Player-Related Information:
    https://guavaman.com/projects/rewir...ontrollerHelper_MapHelper_LoadDefaultMaps.htm
     
  26. MetalDonut

    MetalDonut

    Joined:
    Feb 7, 2016
    Posts:
    113
    Hi Guys,

    I've got a down button (which makes my character crouch) which works fine with keyboard using GetButtonDown. I want the same thing to happen on a joystick/gamepad when pushing the left stick down.

    My understanding is that an axis can work like a button and use the GetButtonDown command as if a button was pressed. I've shared how I thought I needed to set it up by using the negative axis range with positive axis contribution but it doesn't work (nothing happens when I push down on the left stick).

    What am I doing wrong? FYI - My button dead zone is 0.5.

    Thanks!

    upload_2020-2-20_9-44-1.png
     
  27. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    https://guavaman.com/projects/rewired/docs/HowTos.html#button-press-types

    Negative Buttons:

    Each of the methods above also has a corresponding Negative Button method which is named the same except with NegativeButton in place of Button. These serve to allow you to use axes as buttons and will trigger when the negative side of the axis is activated while the standard Button version will trigger only when the positive side of the axis is activated. However, it is usually easier to just map each pole of the axis to a seperate Action (split axis) so that each Action can just be queried with GetButton.

    If you want all GetButton calls to return True when either the positive or negative side of the axis is activated, enable the option "Activate Action Buttons on Negative Values" in the Rewired Editor.
     
  28. MetalDonut

    MetalDonut

    Joined:
    Feb 7, 2016
    Posts:
    113
    Ah, makes sense, thanks. Activating Action Buttons on Negative Values does the job for me. Cheers!
     
  29. rosor

    rosor

    Joined:
    Nov 15, 2009
    Posts:
    3,757
    hello @guavaman So a while ago I tried to upgrade a 2018.4.12 project to a 2019.2.14. The 2018 version was all set up with the hooks etc to have the controllers input working, however upon upgrading the project nothing was working anymore.
    Pretty sure there was an upgrade guidelines .txt somewhere that I'm pretty sure I followed to the letter...
    Is there some special requirements that I'm not aware of in order to make the smoothest upgrade possible.

    It was a while back but all the errors came from your specific asset folder and scripts... I'd like to upgrade the project in order to enjoy the 2019+ features and other assets upgrades.

    Looking forward to hearing back from you.

    Thanks for your time.
     
  30. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    The documentation is here:
    https://guavaman.com/projects/rewired/docs/Updating.html

    There is nothing special you have to do to upgrade Rewired beyond making sure the Rewired folder is the root Assets folder and not in some sub folder. Rewired will not generate any errors after being upgraded. Any errors generated can only possibly be due to something outside Rewired's ability to control such as:

    1. Cosmetic Unity errors such as this:
    https://guavaman.com/projects/rewired/docs/KnownIssues.html#assembly-errors-2019-2

    2. Serialized data corruption:
    https://guavaman.com/projects/rewir...ialized-data-corruption-after-upgrading-unity

    3. Compiler errors caused by you making changes to Rewired scripts and referencing those from other scripts, upgrading Rewired, the changes are reverted, and your code breaks.

    4. Issues with ASMDEF files.

    5. Others.
     
    rosor likes this.
  31. rosor

    rosor

    Joined:
    Nov 15, 2009
    Posts:
    3,757
    Thanks for the prompt reply.

    I might come up with some screen captures if I get some weird errors mentioning Rewired. Hopefully this time the upgrade process will be butter smooth.
     
  32. danbg

    danbg

    Joined:
    May 1, 2017
    Posts:
    61
    Hello. I'm trying to access a PlayerMouse script included as component in a GameObject but I haven't been able.

    Right now I have two mouse pointers inside a Rewired Event System in a GameManager GameObject loaded a preload scene and kept in a DontDestroyOnLoad. I need to change at runtime the Movement Area limits from them in different scenes.

    At first I tried to access them linking them with the inspector, but they're not showing there. The I tried to access them using Find and GetComponent, but PlayerMouse is not derived from MonoBehaviour. How could I do it? Thanks.
     
  33. rosor

    rosor

    Joined:
    Nov 15, 2009
    Posts:
    3,757
    @guavaman So, now I remember what happened before. I just did an update of Rewired. All went fine. Just like before. What went south was when I upgraded the entire project from 2018.4.12 to 2019.2. This was where I got errors thrown mentioning Rewired. I'm currently Upgrading my back up again to 2019.3.2.

    Do you happen to know if there are any known issues with this?

    Thanks
     
  34. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    There are no issues with upgrading from any to any version of Unity.

    You are upgrading a major version of Unity. That means you must also upgrade Rewired. Rewired 2018 is not built for 2019. It will contain code that has been deprecated. This would be the same for any asset.
     
    rosor likes this.
  35. rosor

    rosor

    Joined:
    Nov 15, 2009
    Posts:
    3,757
    So what you're saying is that after the upgrade process is finished I have to re update rewired again? Correct?
     
  36. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    See the Player Controllers documentation:
    https://guavaman.com/projects/rewired/docs/PlayerControllers.html

    Creating

    You can create a Player Mouse in two ways:
    • Add the Player Mouse component to a GameObject and configure settings in the inspector.
    • Instantiate a PlayerMouse via scripting:
    These are two different systems. Creating the PlayerMouse by script, you are creating a C# object, not a MonoBehaviour. Creating the PlayerMouse by using the Component, you are creating a MonoBehaviour wrapper for the same PlayerMouse #C object.

    If you want to use the inspector, you have to use the Component. You cannot use GetComponent to get a non-Behaviour derived object. If you do not use the Component version, you must store a reference to the PlayerMouse object after you create it to use it.
     
  37. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    Yes. There's no other way to do it. If you try to upgrade Rewired first, you might get errors in Unity 2018. All the serialized data was saved in Unity 2019 and isn't compatible with 2018 because Unity cannot be forward compatible. This is the same for any asset or script.
     
    rosor likes this.
  38. rosor

    rosor

    Joined:
    Nov 15, 2009
    Posts:
    3,757
    Thanks a lot! Fingers crossed after the 2019 upgrade is done, updating rewired will solve everything. :)
     
  39. rosor

    rosor

    Joined:
    Nov 15, 2009
    Posts:
    3,757
    ok so finished the upgrade to 2019.3.2... did everything to the letter and I still end up having an error with Rewired it looks like...
    here is the Console log: "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>"
    Any idea how to fix this?
    Thanks in advance for your time.
     
  40. danbg

    danbg

    Joined:
    May 1, 2017
    Posts:
    61
    Thank for the reply. The fact is that I'm using the Component in a GameObject and I can modify Movement Area with the Inspector, but then I want to change that Component Movement Area in runtime. I can access that GameObject but I can't access its PlayerMouse Component and I don't know how. Thanks.
     
  41. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    This is not an error in Rewired. This is the cosmetic Unity error I posted above and it's also the bold warning at the top of the documentation:
    https://guavaman.com/projects/rewired/docs/
    https://guavaman.com/projects/rewired/docs/KnownIssues.html#assembly-errors-2019-2
     
    rosor likes this.
  42. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    Last edited: Feb 21, 2020
  43. rosor

    rosor

    Joined:
    Nov 15, 2009
    Posts:
    3,757
  44. danbg

    danbg

    Joined:
    May 1, 2017
    Posts:
    61
  45. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    Rewired 1.1.30.1 is available on the Unity Asset Store.

    Please see Updating Rewired before updating.

    Release Notes:

    1.1.30.1:

    Changes:
    - Rewired Editor: Tools -> Export Consts last saved path reverts to the project Assets folder if the last saved path was outside the current project.
    - RewiredPointerInputModule: Disabling PlayerMouse by setting PlayerMouse.enabled to false or disabling the Component or GameObject if using the Component version now results in mouse exit events being sent when disabled if hovering over a Selectable.
    - Windows Standalone, Raw Input / Direct Input + Native Keyboard Handling: Added workaround for Steam bug. Steam overlay blocks Raw Input key up events from reaching the application causing keys held when the overlay is opened to be stuck on when the overlay is closed with the mouse.

    Controller Definition Changes:
    - Windows Fallback: Changed definitions for XInput controllers due to undocumented breaking change made in Unity 2018.3 causing both triggers to activate when either trigger is pressed. (Microsoft Xbox 360, Microsoft Xbox One, Logitech F310 (X), Logitech F710 (X), Zhidong V Plus (XI Mode).

    Bug Fixes:
    - Control Mapper (Text MeshPro): Fixed Players and Controllers headers not loading values from language.
     
  46. Roman-Ilyin

    Roman-Ilyin

    Joined:
    Oct 9, 2013
    Posts:
    11
    Hello. I've just updated rewired to latest 1.1.30.1.u2019 (unity 2019.3.3) and my project could not compile it (visual studio 2017):

    Ошибка CS0535 "ExternalTools" не реализует член интерфейса "IExternalTools.PS4Input_GetSpecialControllerInformation(int, int, object)". Assembly-CSharp D:\workspace\Unity\TacticsProject\Assets\__AssetStore\Rewired\Internal\Scripts\Misc\ExternalTools.cs 84

    (CS0535 C# does not implement interface member)

    upload_2020-2-28_13-22-24.png
     
  47. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    You can get this error is if ExternalTools.cs is not from the same version of Rewired as Rewired_Core.dll.

    Do this:
    https://guavaman.com/projects/rewired/docs/Troubleshooting.html#clean-reinstall

    The interface is declared in Rewired_Core.dll and implemented in ExternalTools.cs.

    Nothing has changed in ExternalTools.cs in a very, very long time. I'm going to guess you updated from a very old version of Rewired, and that you now have two copies of ExternalTools.cs in your project because I can see you have Rewired in folder called "__AssetStore". Did you follow the directions and move it to the root Assets folder before you updated? If you didn't, Unity may have created another copy of the CS file with a different GUID when it extracted from the Unitypackage.

    https://guavaman.com/projects/rewired/docs/Updating.html
     
    Last edited: Feb 28, 2020
  48. Aezoc

    Aezoc

    Joined:
    Jan 19, 2020
    Posts:
    2
    Hi, I'm using Rewired in a project where the player can pan the camera around. I'm envisioning using a thumbstick to control the camera with a gamepad, and that's simple enough. With KB/M controls, I'd like to have the camera pan when the mouse cursor is close to the edge of the screen (fairly standard RTS-style camera).

    This is also pretty straightforward if I write code specifically for the mouse, but is there a way to create an input behavior or input filter or something so that I can use the same code path for both of these? I guess conceptually I want the mouse cursor to behave as a virtual joystick with a massive deadzone for the purpose of camera control.
     
  49. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,285
    Rewired does not offer this feature.
     
  50. JohnBrindle

    JohnBrindle

    Joined:
    Jan 3, 2014
    Posts:
    8
    Hi Guavaman, purchased your asset the other day and currently just getting my head around it.

    Started messing with the "PressStartToJoin" example as I have a 4 player split screen game Im developing. I was using Unity's new input system but ran into al sorts of issues and with it being quite a new package its support isn't great yet.

    Anyway the way my game works is a player picks up a gamepad and presses start then a Prefab player will be instantiated in there start area, again the next player presses start and the screen will split up for a two player game and again the player 2 prefab will be instantiated in to there start area... this can be done up to four times for a four player split screen game.

    I quickly got this to work using your example and deleting the players from the scene and creating prefabs of them and by simply adding a public GameObject list for the prefabs then added "Instantiate(playerShips[rewiredPlayerId])" just before the line "playerMap.Add(new PlayerMap(rewiredPlayerId, gamePlayerId))". This works perfectly although it may a complete fluke as I'm very much a novice.

    Now my problem comes when I try this in my own game, I've copied the "PressToJoinGame" script and added the line "private Rewired.Player player { get { return PlayerManager.GetRewiredPlayer(playerId); } }" to my PlayerShip controller script. When I press Start it instantiates my player 1 ship and I can control it, when I press start on the second gamepad it instantiates my player 2 ship but I cannot control it from the player 2 gamepad. When I go back to player 1 gamepad it controls both player 1 and player 2's ships.

    Am I missing something or am I going about this the wrong way. I really appreciate anyone who maybe able to point me in the right directions.
     
unityunity