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,633
    Managing how you want Controller Maps to behave is up to you as the developer to determine. Rewired's Player is a controller container that can load maps for assigned controllers to map elements to Actions. It does not enforce any kind of specific use-case of how you should use Controller Maps, map categories, or layouts. You are free to use them however you want. This is documented in How To's - Enabling and disabling Controller Maps.

    Player does not maintain any data about the "currently enabled" categories, layouts, etc. Each map is either enabled or disabled individually. Player does not force you to use Controller Maps in this one specific limited use-case scenario. If you want it to work that way, you enable and disable the Controller Maps as you see fit in the events provided when changing controllers, etc.

    You should be tracking what map categories (game modes) are enabled and disabled in your own scripts, not in Rewired's Player class by looking at the enabled states of individual Controller Maps. Game state is the responsibility of your game code, and Rewired's Controller Map enabled states should simply be made to match every time you change state.

    Id's are generated when a controller is connected. If you have 5 controllers connected, they will be id 0-4. When you disconnect one and reconnect it, it will retain the same id as before if it can be identified correctly, but if not, it will receive a new id. You should never rely on the controller id's value for knowing which controller is first, primary, or anything of that nature.

    The following is a better approach in my opinion. Simply set your maps enabled through this helper class instead of setting it directly in the Player. You are defining a "current state" for every Controller Map category and enforcing that in the Player whenever a Joystick is connected. Call RewiredMapStateHelper.SetMapCategoryEnabled every time you change game states instead of doing it manually in the Player. If you allow manual joystick to Player assignment by the user, you would want to call UpdatePlayerMaps after re-assigning.

    Code (csharp):
    1.  
    2. public static class RewiredMapStateHelper {
    3.  
    4.         private static readonly Dictionary<int, bool> _categories = new Dictionary<int, bool>();
    5.  
    6.         static RewiredMapStateHelper() {
    7.  
    8.             // Subscribe to controller events
    9.             ReInput.ControllerConnectedEvent += OnControllerConnected;
    10.  
    11.             // Set up categories
    12.             foreach(var mapCategory in ReInput.mapping.MapCategories) {
    13.                 _categories.Add(mapCategory.id, false);
    14.             }
    15.         }
    16.  
    17.         public static void SetMapCategoryEnabled(int mapCategoryId, bool state, bool exclusive) {
    18.    
    19.             // Disable everything first if exclusive
    20.             if(exclusive) {
    21.                 var keys = _categories.Keys;
    22.                 foreach(var key in keys) {
    23.                     _categories[key] = false;
    24.                 }
    25.             }
    26.  
    27.             // Enable the current category
    28.             _categories[mapCategoryId] = state;
    29.  
    30.             // Update the maps in the Players
    31.             UpdatePlayerMaps();
    32.         }
    33.  
    34.         public static void UpdatePlayerMaps() {
    35.             // Set the enabled state of all maps in all Players
    36.             foreach(Player player in ReInput.players.AllPlayers) {
    37.                 foreach(var kvp in _categories) {
    38.                     player.controllers.maps.SetMapsEnabled(kvp.Value, kvp.Key);
    39.                 }
    40.             }
    41.         }
    42.  
    43.         private static void OnControllerConnected(ControllerStatusChangedEventArgs args) {
    44.             UpdatePlayerMaps();
    45.         }
    46.     }
    This could be expanded to separate controller types, add Layout enforcement, etc. You can even save the current states and load them if you need that feature. Note that you will need to set the initial values of the states on start by calling SetMapCategoryEnabled on the ones you want to be enabled at start or everything will be disabled the next time you call SetMapCategoryEnabled.

    Rewired's Controller Map system was intentionally left open as to how exactly it works so the developer could be free to treat Controller Maps, categories, and layouts however they want for their own needs.
     
    Last edited: Nov 21, 2018
  2. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hello,

    I just bought Rewired, looks really great so far. Because I'm not used to this plugin I'm not quite sure how to "design" player interactions/inputs/events. Basically, I don't know if each "input" should be handle by Rewired.

    For example, I'm working on mobile game in which the player can touch (drag or swipe) the screen and start moving the camera. There can be characters in the level - if the player touch a character, it will start by dragging and moving the character and if it gets close to the edge the camera will start moving too.

    So for a same input, a touch in my case, different actions are available depending on what has been touched. Is that something Rewired can handle ? I'm asking that, because we might handle physical input devices later on, so having actions binded to inputs could help.

    Thanks
     
  3. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    Rewired is not primarily a touch input system. See the FAQ:
    http://guavaman.com/projects/rewired/docs/FAQ.html#touch-gyro-accelerometer

    Does Rewired support touch and gyro/accelerometer control?

    On-screen touch joysticks
    Rewired comes with set of pre-built touch controls for use directly in your games. For other special needs, you can use the Custom Controller system to pipe in data from any kind of control which you can either build or download from the Unity Asset Store or elsewhere. There is a simple on-screen touch joystick example included with Rewired showing the concept.

    Touch swipes and gestures
    Rewired does not include any handling of swipe or gesture recognition. For gestures, if it makes sense to map them to input Actions, you can use the Custom Controller system coupled with a gesture recognizer script/asset and pipe the gestures in as button values in a Custom Controller and then map those buttons to Actions.

    Gyro and accelerometer input
    Rewired comes with a Tilt Control component which can be used for basic tilt input. It also supports tilt and rotate on the Siri Remote on tvOS, and the gyro on the Sony Dual Shock 4 and Nintendo Joy-Cons (Switch platform only). For any other tilt/motion needs, you can use UnityEngine.Input to get the motion data, process it, and then use that information to feed into a Custom Controller to map certain types of motion to Actions. Rewired also comes with a simple tilt control example.

    I really don't understand what you're asking. Actions are Actions and are always available for scripts to consume. You can enable and disable Controller Maps or Action Element Maps to prevent elements from contributing value to the Action or you can just stop checking for the value of that Action in your code.

    The only possible way to bind arbitrary touch gestures to Actions is through a Custom Controller.
     
  4. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hi,

    I know that Rewired is not primarily a touch input system - that was not my question. It was more about how to design inputs handling with Rewired in case like mine. Maybe I did not explain myself clearly enough. But I did find a way to achieve what I wanted using Rewired so I guess my design is not that bad. I created 3 category maps - the first one is always activated and its purpose is to know when the user touches the screen, at that point I can detect if there is a character under the touch or not. Depending on the result I activate another category map that handles inputs/actions related to camera or character movement. When the touch is over, I deactivate that category.

    Thanks
     
  5. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    It was not clear to me by your question that you were already using Custom Controllers to bind Unity touch events to Actions. You stated you just bought Rewired and very few users who just start using the package go into that level of the system.

    I didn't (and still don't) understand your use case very well, but one solution is what I suggested and what you already figured out -- enable and disable Controller Maps or Action Element Maps as needed.

    You could also achieve the same thing by setting flags in your code when certain Actions return true or false. Instead of always checking the values of all your Actions and letting the Controller Maps determine which have value, only check the Actions you need based on the flag states.

    Code (csharp):
    1. bool isPlayerTouched;
    2.  
    3. isPlayerTouched = player.GetButton("IsPlayerTouched");
    4.  
    5. if(isPlayerTouched) {
    6.     // do allowed stuff when player is touched
    7.     // these Actions are only ever queried if the Player is being touched.
    8.     float dragX = player.GetAxis("DragPlayerX");
    9.     float dragY = player.GetAxis("DragPlayerY");
    10. }
    The Custom Controller script would determine when the Player is touched or not. Any other code in the script can also use the isPlayerTouched boolean for flow control.
     
  6. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    If you want to use the same code for touch and joystick input, you might want to keep things more abstract:

    Code (csharp):
    1. Vector2 move = player.GetAxis2D("MoveHorizontal", "Move Vertical");
    The value of Move Horizontal and Move Vertical for touch input would come from a Custom Controller script that tracks when the Player is touched and dragged and populates the values as appropriate. The Custom Controller script would be the one doing the work of figuring out what's being touched and what the player is trying to do, then it populates the appropriate elements that are bound to Actions.

    For joysticks, keyboard, mouse, the value comes from the hardware. The interface is the same between the two so you don't have any touch-specific code in your game scripts.
     
  7. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    @guavaman Because XInput only supports 4 controllers and we are wanting to support 6 - 8 players, I'm considering switching to using Direct Input.... Is the main thing I lose when not using XInput the lack of rumble support?

    My other question was......
    Is it possible to toggle the InputManager Windows input source between XInput and Direct Input at runtime? It would amazing if I could allow the user to choose between the 2 at runtime.
     
  8. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    798
    @guavaman

    I see Button Repeating listed as a Input Behavior option in the docs, but I don't have the field in the Input Manager inspector of my version of Rewired (1.0.0.112).

    Am I just being dense?

    Thanks!
     
  9. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    I suggest just disabling XInput and leaving it on Raw Input, not changing to Direct Input.

    Your question about XInput features is answered here:
    http://guavaman.com/projects/rewired/docs/KnownIssues.html#more-than-4-xbox-controllers

    http://guavaman.com/projects/rewired/docs/HowTos.html#changing-configuration-settings-at-runtime
     
    rxmarccall likes this.
  10. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    You are using a version of Rewired 1 year and 10 months old and 56 of releases out of date. Update Rewired and you will have all the features you see in the documentation for 1.1.21.0 that you are reading.
     
  11. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    798
    Got it, apologies! (I really feel like I've updated more recently than that. Time flies I guess)
     
  12. csofranz

    csofranz

    Joined:
    Apr 29, 2017
    Posts:
    1,556
    Hi everyone,

    just got Rewired on the recommendation of a friend and have integrated it into a project - the Action scheme is superior to Unity's default by orders of magnitude - great job!

    Out of curiosity - will Rewired implement support for VR controllers (by which I don't mean the controller's buttons - I'm assuming that's not that difficult - but gestures and/or spatial positioning)? I haven't yet looked inside Rewired, nor if there is an API for this, so my apologies if I'm asaking something stupid.

    Cheers,
    -ch
     
  13. guavaman

    guavaman

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

    No, there are no plans for adding a VR gesture layer, spatial positioning, head tracking, touch gestures, etc.

    See this from the FAQ. It's not directly addressing you question, but it is relevant.
    http://guavaman.com/projects/rewired/docs/FAQ.html#gesture-bindings
     
  14. funselektor

    funselektor

    Joined:
    Oct 11, 2013
    Posts:
    105
    Hey! This one's for the suggestion box, but what about having the mapping guide here in the input manager?

    Would save me from always googling it everytime I'm trying to map a controller.


    upload_2018-11-24_13-46-13.png
     
    GioSales, rrahim and f0ff886f like this.
  15. f0ff886f

    f0ff886f

    Joined:
    Nov 1, 2015
    Posts:
    201
    Hi Guavaman,

    I'm having a bit of trouble understanding how to switch layouts in scripts from the documentation. I'm trying to simply switch a Mouse layout from Normal to Switched (inverting buttons). I've got it all made in the editor, but in the code I'm sort of losing my way in the documentation.

    I started here: http://guavaman.com/projects/rewired/docs/HowTos.html#managing-controller-maps-runtime and I'm trying to load a new map, as I understand a Map is defined by the input type, category ID and Layout ID. I don't have any categories beyond default, and I just have two layouts, ID 0 and ID 1.

    To load ID1, I'm trying this:

    Rewired.ReInput.players.GetPlayer(0).controllers.maps.LoadMap(Rewired.ControllerType.Mouse, 0, 0, 1, true);


    But it doesn't seem to be working. Do I need to disable the other map with `RemoveMap` before doing this?

    Edit: If I try with this:

    Code (CSharp):
    1. Rewired.ReInput.players.GetPlayer(0).controllers.maps.RemoveMap(Rewired.ControllerType.Mouse, 0, 0, 0);
    2. Rewired.ReInput.players.GetPlayer(0).controllers.maps.LoadMap(Rewired.ControllerType.Mouse, 0, 0, 1);
    It seems like I just lose all my mouse input. This is just a single player game by the way.

    Thanks!
    Matt
     
    Last edited: Nov 24, 2018
  16. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    Use Debug Information:
    http://guavaman.com/projects/rewired/docs/Troubleshooting.html#debug-information

    You can see exactly what's being loaded in the Player. You can see every binding on the controller maps. You can see real-time values of Actions. Always the first thing you should do when having problems is use Debug Information to try to understand what's happening.

    Remove it or disable it or you will have two Controller Maps being used at the same time to determine the values of Actions:
    http://guavaman.com/projects/rewired/docs/HowTos.html#enabling-disabling-controller-maps

    Provided you actually have a Mouse Layout set up with an ID of 0 and not an index of 0, I see nothing wrong with this code.

    Export constants instead of using integers:
    http://guavaman.com/projects/rewired/docs/HowTos.html#exporting-constants
     
    Last edited: Nov 25, 2018
    f0ff886f likes this.
  17. f0ff886f

    f0ff886f

    Joined:
    Nov 1, 2015
    Posts:
    201
    Awesome! Thank you for the help, your note about "Provided you actually have a Mouse Layout set up with an ID of 0 and not an index of 0" was the key, I was looking at the indices and assuming thats the ID, but now I see that there is a unique
    Layout Id
    ! That was it, I was using the wrong ID :)

    Thank you, and for the note about constants, I didn't know about that and its made the code much, much cleaner as well.

    Question, is there a recommendation to choose between disabling or removing maps?
     
  18. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    Glad you got it working.

    No preference. It's up to you depending on your use case for Controller Maps. If it's something that needs to be done frequently switching back and forth between layouts, loading both in the Player at start through the Rewired Input Manager Player page and having one disabled, then enabling and disabling as needed would be appropriate. If it's something that rarely needs to be done, unloading and loading would be appropriate.
     
  19. tspk91

    tspk91

    Joined:
    Nov 19, 2014
    Posts:
    131
    Hi, is there an indepth explanation of sensitivity modes/curves of axes somewhere in the docs? Also, is there any built-in way to check for idleness of a specific controller/mouse? Thanks!
     
  20. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    No. They are only documented in the API reference:

    http://guavaman.com/projects/rewired/docs/HowTos.html#calibrating-controller-axes
    http://guavaman.com/projects/rewired/docs/api-reference/html/T_Rewired_AxisCalibration.htm
    http://guavaman.com/projects/rewire...P_Rewired_AxisCalibration_sensitivityType.htm
    http://guavaman.com/projects/rewired/docs/api-reference/html/T_Rewired_AxisSensitivityType.htm

    Multiplier - value * sensitivity
    Power - Mathf.Pow(value, sensitivity)
    Curve - value * sensitivityCurve.Evaluate(value); // Value must be -1 to 1 range.

    http://guavaman.com/projects/rewire...load_Rewired_Controller_GetLastTimeActive.htm
     
    Last edited: Nov 26, 2018
    tspk91 likes this.
  21. daven8989

    daven8989

    Joined:
    Jan 25, 2014
    Posts:
    29
    Hello guavaman,
    I think there is a bug in DualShock4Extension class. The batteryLevel attribute (in standalone windows platform selected) is always 20 (instead of 0 - 100 value). My ps4 controller is fully charged and the attribute still return 20. I checked connecting the controller to ps4 and the value of the battery level displayed inside is correct.
    Can you please check if there is something wrong with batteryLevel attribute?

    Thank you very much,
    Dave.
     
  22. jason07

    jason07

    Joined:
    May 10, 2011
    Posts:
    34
    Hi,

    First of all, great asset! I was able to get up and running with this in no time and it's so much easier than Unity's standard input.

    My question is regarding Control Mapper. Is there a way to show only the invert option for a certain element? I want to give the player the option to invert the mouse x and y axis, but not the ability to reassign/remove the mouse axis movement. The reason is just to foolproof it in case they accidentally remove the assignment.

    Thanks!
     
  23. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    Glad you like it!

    No. There are no individual-per-controller-element or per-Action settings in Control Mapper.
     
    Last edited: Nov 30, 2018
  24. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    I can't find any issue. The 4-bits read from the input report is the correct 4 bits as far as I can find from the information available on the web. My DS4 reports values between 70-100 currently. You will only ever see values in increments of 10%.

    Is the DS4 connected via wire or Bluetooth?
     
  25. mmanno

    mmanno

    Joined:
    Nov 18, 2014
    Posts:
    4
    Hi, I'm having an issue when I set the "Default Joystick Dead Zone Type" to "Axial". Right Stick x and y, and Left Stick x and y, only report negative values. For instance if move the stick downward it correctly reflects -1, but if I move the stick up it incorrectly reflects 0. However, the "Rewired Input Manager" debug information in the editor reports values correctly.

    My Joystick map is using the Default layout for the "[T] Gamepad Template *".

    If I set the "Default Joystick Dead Zone Type" to "Radial" it reports x and y as expected.

    Unity version: 2017.3.1f1
    Rewired version: 1.1.21.0.U2017

    Do you have any suggestions?
     
    Last edited: Dec 2, 2018
  26. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Hi, just a quick question, if I am building for macOS standalone with IL2CPP, is it safe for say I should use Unity as input source? Are both Native and SDL2 unavailable for IL2CPP build at the moment?

    (Actually, color me a bit confused as I thought Unity had SDL built-in, but is it used on macOS?)
     
  27. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    There's no need to explicitly set it to Unity. It will automatically fall back to Unity input.

    SDL2 should work but has not been tested.

    Unity does not have SDL2 built in as far as I know and Unity OSX does not use SDL2 for input. Only Unity Linux does.
     
    bitinn likes this.
  28. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    If that's the case, the problem must lie in your code. The Debug Information tool uses the exact same methods to get Action values: player.GetAxis().

    Are you logging the value immediately after getting it from player.GetAxis when you see up = 0 or is this the final result of some movement code?
     
  29. mmanno

    mmanno

    Joined:
    Nov 18, 2014
    Posts:
    4
    Thanks for the reply.

    Is it important to note that the x and y axis register correctly if I am using radial input?

    With the following code the variable "v2" only registers negative values:

    Code (CSharp):
    1. using UnityEngine;
    2. using Rewired;
    3.  
    4. public class Test : MonoBehaviour {
    5.         private Player rwPlayer;
    6.         private Vector2 v2;
    7.  
    8.     private void Awake(){
    9.         rwPlayer = ReInput.players.GetPlayer(0);
    10.     }
    11.  
    12.     private void FixedUpdate() {
    13.         v2 = new Vector2(rwPlayer.GetAxis("v"), rwPlayer.GetAxis("h"));
    14.     }
    15. }
    The issue persists on both xbox 360 and xbox one controllers. This is how I have the vertical axis ("v") set up:



    The horizontal axis ("h") is set up similarly.

    Could the issue be that I am not running Unity 2018?

    Thank you for the help.
     
    Last edited: Dec 3, 2018
  30. daven8989

    daven8989

    Joined:
    Jan 25, 2014
    Posts:
    29
    Thank you for the anwser,
    the controller is connected via Bluetooth. If I connect the DS4 with the wire the value in batteryLevel is -10 (minus 10).
     
  31. MackThax

    MackThax

    Joined:
    Jan 30, 2015
    Posts:
    2
    Hi!
    When I play the game in editor, (keyboard and mouse) input works fine, but when I undock the game window while the game is running, input stops working. If I dock the game window back, input starts working again.

    If I undock the window while the game isn't running, and then press play, input works fine in undocked window, but stops working if I dock the window while the game is running.

    Is this a known issue or should I investigate further?
     
  32. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    (1) What version of Unity?
    (2) What operating System (Windows, Mac, etc.)
    (3) What version of Rewired are you using?
     
  33. Miguel_TagaiArts

    Miguel_TagaiArts

    Joined:
    Jan 12, 2018
    Posts:
    39
    Hi there. I have a very specific scenario for a very specific thing and I'm sure that it must be very easy to solve, but I'm failing to find out how. Here's the thing:

    I have an options menu that contains a full button remapper using Rewired's own solution as a base. As a common behaviour, I want to implement "key exclusivity" (i.e. one key or button cannot be assigned to multiple actions), and I already have all the code structure in place and working, but I'm missing the final touch. Let's say that I have the 'P' key assigned to the "Interact" action, but then using the control mapper I assign it to "Cancel" as well. In that case, I want to set the original ("Interact") to None, so there is no key assigned to that action until the user updates it with a new one.

    Is it possible to achieve that, and how? Thanks in advance.
     
    Last edited: Dec 3, 2018
  34. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    This should only affect the mouse, not keyboard and only in Unity 2018, only on Windows, and only when using Raw Input / Direct Input + Native Mouse Handling. It was fixed in 1.1.20.0.
     
  35. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    I need more information:

    1. What platform is this?
    2. What version of the DS4 are you using? Look at the sticker on the back and get the model number.
     
  36. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    Not particularly, but it does inform exactly what code path is being used.

    If you change FixedUpdate to Update what do you get? Do you have FixedUpdate enabled in the Rewired Input Manager Settings page?

    I see no issue with the mappings.

    No. This wouldn't have any bearing on this.

    I cannot reproduce this with any combination of settings or variables. Based on the code that calculates the axis value, I cannot imagine anything that could possibly cause this short of the controller definitions for these axes being changed which would change the dead zone or the axis range of the axes at the hardware level. (Similarly, modifying the Calibration Map for the axes incorrectly in code could also do the same thing.) Have you been modifying the included controller definition files? Unity's serialization system could also be the problem which has prone to data corruption under a number of different circumstances (updating packages, upgrading Unity, etc). Corrupted data in the controller definition files could cause all kinds of issues. Follow these instructions to do a clean re-install of Rewired.
     
    Last edited: Dec 3, 2018
  37. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    Conflict checking with optional conflict replacement is already built into Control Mapper and functions out of the box.

    Certain rules for assignment replacement can be specified in the inspector:
    http://guavaman.com/projects/rewired/docs/ControlMapper.html#inspector-element-assignment-options

    Conflict checking rules are determined by your settings in the Rewired Input Manager:
    http://guavaman.com/projects/rewired/docs/ControlMapper.html#conflict-checking
     
    Miguel_TagaiArts likes this.
  38. Miguel_TagaiArts

    Miguel_TagaiArts

    Joined:
    Jan 12, 2018
    Posts:
    39
    Perfect, I knew I had to be missing something awfully simple.

    Thank you very much.
     
  39. daven8989

    daven8989

    Joined:
    Jan 25, 2014
    Posts:
    29
    I'm using Unity3D in Windows 10, the platform selected is Standalone Windows x86_64 build, and this behaviour appear both in editor and in build.

    The version of DS4 is MODEL: CUH-ZCT2E (I buyed these DS4 during black friday).
     
  40. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    This appears to be a new model number. The previous "new" controller was CUH-ZCT2U. I will have to see if I can get one and determine if it's possible to differentiate them. I don't know if I will be able to figure out what the new address is for the battery level in the input report though.
     
  41. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,838
    I have a Logitech Cordless Rumblepad 2 connected to my system. Rewired is reporting this as Logitech F710 under the Name (see below) and when displaying the Element Identifier names in the control mapper.
    The Logitech Cordless Rumblepad 2 actually has buttons labeled 1,2,3,4
    Whereas the F710 has buttons A,B,X,Y
    So the Control Mapper is reporting the buttons as A,B,X,Y instead of 1,2,3,4.

    http://guavaman.com/rewired/files/docs/RewiredControllerElementIdentifiersCSV.zip

    controller.png

    Could it be a controller/device/driver issue or a rewired issue?

    driver.png

    (This is not a major issue for me due to how old the controller is)
     
    Last edited: Dec 4, 2018
  42. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    Controller manufacturing issue. They used the exact same identifiers for the F710 as the Cordless RumblePad 2. Plug an F710 in and you will see the name reported as "Logitech Cordless RumblePad 2", not F710. Rewired explicitly supports the F710, not the Cordless RumblePad 2, cannot tell the difference between the two, and therefore must identify it as one or the other so it's an F710.

    You're using a quite old version of Rewired as well, which while it has no bearing on this issue, should be updated to the latest version before requesting support.

    http://guavaman.com/projects/rewired/docs/Updating.html
     
  43. mmanno

    mmanno

    Joined:
    Nov 18, 2014
    Posts:
    4
    FixedUpdate is turned on, and using Update instead changes nothing.

    Well at least I have that going for me.

    Thanks

    I reinstalled it and I'm still seeing the issue. Additionally I re-imported the whole project. Any other ideas?

    Here are pictures of my settings:









    Thanks again!
     
    Last edited: Dec 4, 2018
  44. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    @mmanno

    Can you show me screen shots showing that this value is actually returning positive and negative values in Debug Information when you move the sticks? Because it should be absolutely impossible for Debug Information to be getting one value when it calls player.GetAxis(action) and you be getting a different value when you call player.GetAxis(action) in Update. The value of GetAxis is calculated only once per frame in Rewired update which runs before everything else because it sets its script execution order to -32000 on installation. The value of the Action cannot change at any point until the next cycle when Rewired re-calculates it.

    Please show me a screen shot that shows the value of the Action axis being logged from your script to the console and the debug information panel opened to your Players -> Player -> Actions -> Action Category -> Action with the left stick pressed up.

    Can you try making a new project with nothing but Rewired, change the Axis Dead Zone setting, create one Action, bind it to a joystick axis, and use that script to log the value and tell me if you still see this issue?
     
  45. daven8989

    daven8989

    Joined:
    Jan 25, 2014
    Posts:
    29
    Thank you very much guavaman.
    Please keep me updated if there will be any update about this issue.
     
  46. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    84
    I'm trying to set up a controller with a touch region that supports two touches. Out of the box, the touch controllers are really nice, but they don't support multi-touch, is that right?
    To get around this, I'd like to use this with the "Fingers-Touch Gestures for Unity", but I'm not having much luck with that. Are they compatible? Would this work with Unity's Cross Platform Input?

    Thanks
     
  47. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    No. The Touch Pad component offered in the Touch Controls pack is not a general-purpose touch screen or touch pad that can handle multiple touches, tell you where you are touching, how many fingers are touching, etc. It's a control meant to function the same way mouse input works for rotating the camera in an FPS for example. Rewired's Touch Controls are on-screen controller elements meant to simulate buttons, joysticks, and swipe regions. They contribute button and/or axis values to the Player-Action system so the same code can be used to process physical joystick input and touch joystick input for example. They don't go beyond that purpose.

    You can use any data source you want to pipe input in the Rewired's Player-Action system. Custom Controllers are designed for this purpose: http://guavaman.com/projects/rewired/docs/CustomControllers.html
     
  48. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Is there a global option to suppress "Rewired: Rewired is not compatible with the IL2CPP scripting backend on Standalone platforms at this time." warning? Maybe also through scripting define symbol?

    My only problem with using symbols is they are a bit difficult to manage (I have requested a change to editor ui here).
     
  49. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Another question: I find myself unable to completely uninstall Rewired. Even when I remove the Rewired folder as well as restoring the InputManager.asset

    The symptom: every sample scenes from other package (even Unity official ones) react to input, but the characters stay in place while walking or running. This problem cannot be reproduced on new repos that doesn't previously has Rewired imported.

    I am using Unity 2018.3.0b12 on macOS with latest Rewired.
     
  50. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,633
    There's no way possible Rewired could be doing anything after you delete the Rewired folder. There is nothing hidden or under the hood that Rewired does. Rewired exists entirely in the Rewired folder. The modification to the Unity input manager just adds new entries for Rewired, it does not delete or change existing ones so it cannot mess up existing UnityEngine.Input code. It does not change code in any scripts either. There is no permanent affect in a project from installing Rewired.

    I don't know what you're referring to when you say "the characters stay in place." What script is controlling these characters movement? The script that controls these characters has to be getting input from somewhere. Check the code and see how they're consuming input to determine why they're not moving.
     
    Last edited: Dec 6, 2018