Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

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,277
    Rewired 1.0.0.75 is available for registered users to download on the website. If you'd like to register to download early updates, please contact me here. The Unity Asset Store should get the update in 5-10 days.

    This update brings Linux native support for flight controllers up to par with Windows and OSX. Now you can make a cross-platform flight simulator or space shooter and have control just work on all 3 major desktop platforms!

    Another change due to popular demand: You are no longer required to have the Unity Editor set to the proper build target for native input to be enabled. When using the editor, it will use the best input source chosen for the current OS rather than reverting to Unity input when the build target does not match the OS platform. A warning will be logged telling you that the controller capabilities in the editor may not reflect those in the final build target.

    1.0.0.75:

    Changes:
    - Added Razer Forge TV platform.
    - In the Unity Editor, when the build target is set to something other than the native OS platform, the chosen input source for the current Editor platform is loaded instead of falling back to Unity input.

    New Controller Definitions:
    - SteelSeries Nimbus (MFi)
    - Apple TV Remote (2015 model)
    - Razer Forge TV: Razer Serval
    - Saitek Combat Pedals
    - New Linux Native Definitions:
    - CH Products Pro Throttle
    - CH Products FighterSitck
    - CH Products Eclipse Yoke
    - CH Products Pro Pedals
    - Saitek Pro Flight Throttle Quadrant
    - Saitek Pro Flight Cessna Trim Wheel
    - Saitek Pro Flight TPM Panel
    - Saitek X45 Digital Joystick & Throttle
    - Saitek X-55 Rhino Stick
    - Saitek X-55 Rhino Throttle
    - Saitek JI3 Cyborg 3D Gold
    - Saitek Pro Flight Yoke
    - Saitek Pro Flight Rudder Pedals
    - ThrustMaster T16000M
    - ThrustMaster T.Flight Hotas X
    - Thrustmaster HOTAS Warthog Joystick
    - Thrustmaster HOTAS Warthog Throttle
    - Logitech Extreme 3D Pro
    - VRinsight Ship Console
    - Arcade Guns G-500 AimTrak Light Gun

    API Changes:
    - Added ReInput.ConfigHelper.osxStandalonePrimaryInputSource property.
    - Added ReInput.ConfigHelper.linuxStandalonePrimaryInputSource property.
    - Added ReInput.ConfigHelper.disableNativeInput property.
    - Added ReInput.ConfigHelper.android_supportUnknownGamepads property.
    - Added ReInput.ConfigHelper.defaultJoystickAxis2DDeadZoneType property.
    - Added ReInput.ConfigHelper.autoAssignJoysticks property.
    - Added ReInput.ConfigHelper.maxJoysticksPerPlayer property.
    - Added ReInput.ConfigHelper.distributeJoysticksEvenly property.
    - Added ReInput.ConfigHelper.assignJoysticksToPlayingPlayersOnly property.
    - Added ReInput.ConfigHelper.reassignJoystickToPreviousOwnerOnReconnect property.

    Bug Fixes:
    - Raw Input: Fixed incorrect Stick Rotate mapping on ThrustMaster T16000M.
    - Raw Input: Fixed incorrect Yoke Z mapping on Saitek Pro Flight Yoke.
    - Amazon Fire TV now uses Amazon Fire TV controller definitions if available instead of Android.
     
    Last edited: Nov 2, 2015
  2. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,541
    This is awesome. A game changer for sure. Finally native input parity for flight controllers. I think @Steve Tack will enjoy this update also.

    Keep up the great work.
     
    guavaman likes this.
  3. cowtrix

    cowtrix

    Joined:
    Oct 23, 2012
    Posts:
    316
    Hey Guavaman, any chance of more documentation coming anytime soon? I'm trying to figure out what methods are doing, but there are a lot of functions, with almost identical names, and no documentation. Like what's the difference between Player.ControllerHelper.MapHelper.GetMaps and Player.ControllerHelper.MapHelper.GetAllMaps? That and a million more questions.

    While I'm aware there are examples, they all seem to be targeting the most complex possible use case (local co-op, joystick support, etc). Finding the bits I need amongst the noise has so far proved unsuccessful.
     
    Last edited: Nov 2, 2015
  4. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277

    http://guavaman.com/projects/rewire...Rewired_Player_ControllerHelper_MapHelper.htm

    GetMaps: "Gets a list of controller maps for a specific controller assigned to this Player."
    GetAllMaps: "Enumerates all controller maps assigned to this Player."

    Help also shows up when typing the method names using if you're using an IDE capable of using XML help like Visual Studio.

    Additionally:
    http://guavaman.com/projects/rewired/docs/HowTos.html#enabling-disabling-controller-maps
     
    Last edited: Nov 2, 2015
  5. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    372
    Hi guys,

    Decided I needed to learn some C# fundamentals, and as a learning exercise made a quick helper for UnityFS- this works much better than the script changes I posted earlier (under a different username), as you can use UnityFS's built-in reflection input mode, and you only need to set the player ID on the helper script, rather than every control surface etc.

    Just drop the script into your aircraft object somewhere, ensure the input actions are named as per your Rewired settings, and then use the reflected input source like so:

    ReflectionHelper1.JPG

    ReflectionHelper.JPG

    As an added extra, I've remapped the throttle axis value to operate from 0 to 1, rather than -1 to 1
     

    Attached Files:

    John-G likes this.
  6. Pserpha

    Pserpha

    Joined:
    Mar 20, 2015
    Posts:
    4
    Hello Guavaman,

    I'm working on a controller mapper. The user can set up 2 keys for every action (main and alternative key). I have 1 layout for the main keys and another for the alternative keys. Now I've run into a problem with axes. The user can set an axis part to an action like "switching between different characters" with only Right Stick X +. But if the user sets Right Stick X - as an alternative key for switching, the input wouldn't be detected anymore. So player.GetButton("switchCharacters") doesn't detect an input. I think the axis parts nullify each other. What key setting do i need to set to get it to work?

    Thanks!
     
  7. blockimperium

    blockimperium

    Joined:
    Jan 21, 2008
    Posts:
    449
    I spent the time last night to integrate this with a new game that we've been working on and I wanted to share all the pain and suffering we experienced getting this working.... That's the end of our report ;)

    One thing though, we are trying to target the WiiU and are curious what integrations are available for that platform since its not listed anywhere.
     
    guavaman likes this.
  8. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    381
    I'm thinking of just making Custom Controllers scripts to use the Wii U controllers with Rewired D: since it doesn't support it directly.
     
  9. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    No, that's not what's happening. GetButton only returns true for positive source values. You have to use player.GetNegativeButton if you have negative source values. Or change the AxisContribution of your split axis assignment to Positive so the source value is returned as positive, then you can use GetButton.
     
    Last edited: Nov 4, 2015
  10. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    There is no integration available for WiiU at this time. WiiU does not use Unity Input system at all and requires you use the WiiUInput class to receive input from any type of controller. Rewired cannot work with WiiU if/until a bridge is created and a lot of new front-end interfaces are created for all the various odd control types (gyros, magnetometers, touch screens, weight measurement, mic/speaker, controller add-ons, etc.)

    Your only choice is to create a CustomController (or multiple) and feed data into Rewired from the WiiUInput methods. Not as versatile (like no controller detection), but it would work.
     
    Last edited: Nov 4, 2015
  11. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    This can work depending on your use case. I know of at least one developer that does this already for his game for supporting WiiU Pro Controllers.
     
  12. Pserpha

    Pserpha

    Joined:
    Mar 20, 2015
    Posts:
    4
    I tried your solutions but unfortunally i still can't get it to work.

    The Input Menu looks like this:


    If the user defines the keys, I set the following stats to it:
    Primary key:
    Right Stick X Left
    AxisRange.Full
    AxisContribution.Negative
    ElementAssignmentType.FullAxis
    invert = true

    Alternative key:
    Right Stick X Right
    AxisRange.Full
    AxisContribution.Positive
    ElementAssignmentType.FullAxis
    invert = false

    It works with GetButton() as longs as i set only one of the directions to the "swap" action. At the moment i set both and GetButton() always returns false.

    Thanks!
     
  13. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    You shouldn't be making a Full axis assignment here. If your assignment is a full axis assignment, you can't use AxisContribution. That only has any effect on split axes to tell the split axis whether to return a positive or negative value. A full axis assignment always returns a range of -1 to 1. You want to be making a split assignment, which it seems like you're trying to do based on the names (Right Stick X Left/Right). A split axis assignment uses AxisContribution to determine whether to return a + or - value in the end. Change AxisRange to Negative (because the source axis value is the negative pole of the axis, not the whole axis) on the Right Stick X Left assignment and AxisContribution.Positive and it will work. The Right Stick X Right assignment should be AxisRange.Positive and AxisContribution.Positive.
     
    Last edited: Nov 5, 2015
  14. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    Rewired 1.0.0.75 is now live on the Unity Asset Store!

    Changes since the last version available on the UAS:

    1.0.0.75:

    Changes:
    - Added Razer Forge TV platform.
    - In the Unity Editor, when the build target is set to something other than the native OS platform, the chosen input source for the current Editor platform is loaded instead of falling back to Unity input.


    New Controller Definitions:
    - SteelSeries Nimbus (MFi)
    - Apple TV Remote (2015 model)
    - Razer Forge TV: Razer Serval
    - Saitek Combat Pedals
    - New Linux Native Definitions:
    - CH Products Pro Throttle
    - CH Products FighterSitck
    - CH Products Eclipse Yoke
    - CH Products Pro Pedals
    - Saitek Pro Flight Throttle Quadrant
    - Saitek Pro Flight Cessna Trim Wheel
    - Saitek Pro Flight TPM Panel
    - Saitek X45 Digital Joystick & Throttle
    - Saitek X-55 Rhino Stick
    - Saitek X-55 Rhino Throttle
    - Saitek JI3 Cyborg 3D Gold
    - Saitek Pro Flight Yoke
    - Saitek Pro Flight Rudder Pedals
    - ThrustMaster T16000M
    - ThrustMaster T.Flight Hotas X
    - Thrustmaster HOTAS Warthog Joystick
    - Thrustmaster HOTAS Warthog Throttle
    - Logitech Extreme 3D Pro
    - VRinsight Ship Console
    - Arcade Guns G-500 AimTrak Light Gun

    API Changes:
    - Added ReInput.ConfigHelper.osxStandalonePrimaryInputSource property.
    - Added ReInput.ConfigHelper.linuxStandalonePrimaryInputSource property.
    - Added ReInput.ConfigHelper.disableNativeInput property.
    - Added ReInput.ConfigHelper.android_supportUnknownGamepads property.
    - Added ReInput.ConfigHelper.defaultJoystickAxis2DDeadZoneType property.
    - Added ReInput.ConfigHelper.autoAssignJoysticks property.
    - Added ReInput.ConfigHelper.maxJoysticksPerPlayer property.
    - Added ReInput.ConfigHelper.distributeJoysticksEvenly property.
    - Added ReInput.ConfigHelper.assignJoysticksToPlayingPlayersOnly property.
    - Added ReInput.ConfigHelper.reassignJoystickToPreviousOwnerOnReconnect property.

    Bug Fixes:
    - Raw Input: Fixed incorrect Stick Rotate mapping on ThrustMaster T16000M.
    - Raw Input: Fixed incorrect Yoke Z mapping on Saitek Pro Flight Yoke.
    - Amazon Fire TV now uses Amazon Fire TV controller definitions if available instead of Android.


    1.0.0.74:

    Changes:
    - OSX Native: Now supports pressure-sensitive buttons on MFi controllers.

    New Controller Definitions:
    - OSX Native: SteelSeries Stratus XL (MFi)

    API Changes:
    - Added Controller.Button.isPressureSensitive property
    - Added Controller.Button.pressure property
    - Added Controller.Button.pressurePrev property
     
    Xander-Davis likes this.
  15. blockimperium

    blockimperium

    Joined:
    Jan 21, 2008
    Posts:
    449
    Feature Requests:

    * When I create a new 'Action', 'Group', etc. Switch to that new item.
    * Need a way to move actions and the like to groups as many times they may start off in some 'Default' group and then get organized later after more thought has gone into the actions themselves. Ideally I'd just drag them from the Action list onto the group to which they belong, but I understand that may not be possible with the GUI the way that it is.
     
  16. Pserpha

    Pserpha

    Joined:
    Mar 20, 2015
    Posts:
    4
    Thank you! That was exactly what i needed. Now it works like a charm :)
     
    guavaman likes this.
  17. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    I will consider whether or not this would improve usability.

    You can already do this with the Category dropdown on the Action:

    ChangeCategory.gif
     
  18. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    854
    Hello Guavaman,

    I am working on a game for Xbox One console. I am interested in your asset but I have a question about it. Do your Rewired asset takes care of the Xbox One TLX regarding users sign in checks?

    Regards,
    Carlos
     
  19. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    Hi,

    No it doesn't.
     
  20. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    854
    Ok, thanks guavaman. I am going to try the trial them and see what I require to do about that part when using your asset.

    Regards,
    Carlos
     
  21. blockimperium

    blockimperium

    Joined:
    Jan 21, 2008
    Posts:
    449
    Gotcha. I wasn't expecting to perform the action that way, but that it can be done at all is perfectly fine with me.
     
  22. MrMMatricks

    MrMMatricks

    Joined:
    Sep 22, 2014
    Posts:
    2
    Hello!

    I have been using ReWired now for quite some time and suddenly I have a bug.
    The ReInput.controllers.joystickCount always returns zero. Even though my XBox 360 controller works perfectly fine with ReInput. But for our game we need the exact count of actually available controllers.
    When I get ReInput.controllers.GetJoysticks().Length I get an null reference exception.
    I am querying this in a Start(); I just checked, the ReInput classes are set higher in the Script execution order.

    I don't know what started it. It could have been the update to a newer version of ReWired or my Upgrade to OSX El Capitan.

    Any tips where this could come from?
     
  23. blockimperium

    blockimperium

    Joined:
    Jan 21, 2008
    Posts:
    449
    Looking for a suggestion for a mobile (iOS/Android) controller UI that works/is designed to work with Rewired. Rather than write one myself I'd rather just grab one off the shelf that is known to work and can be customized. One of the other plugins I use (ThirdPersonController) mentions ControlFreak, but I am unsure if that is due it its compatibility with Rewired.
     
  24. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    Can you explain what you mean by "Even though my XBox 360 controller works perfectly fine with ReInput." ? If ReInput.joystickCount is returning 0, it's not working fine with Rewired.

    I suspect your upgrade to El Capitan may have uninstalled or broken your X360 driver. If the driver does not return HID data to OSX I/O kit, Rewired cannot read the joystick. An easy way to test is to simply add the DevTools/JoystickElementIdentifier to a blank scene, add a blank Rewired input manager, then press Play. If no joysticks appear, OSX isn't reporting the device. You can then disable native input in the Rewired Input Manager and press Play again and see what Unity's seeing from its input implementation. I suspect Unity won't see it either in this case.

    You'll probably need to reinstall the X360 driver. Either the Tattie Bogle driver or the newer X360 driver.
     
    Last edited: Nov 9, 2015
  25. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    None exist as far as I know. But you should be able to take any of them and easily interface them with Rewired using the Custom Controller system. This is exactly the use case it was designed for. The included example shows how.
     
  26. blockimperium

    blockimperium

    Joined:
    Jan 21, 2008
    Posts:
    449
    Thanks. Let me see who has a good one on the store so I can get past this mobile bit. The more awesome part is because of the way Rewired is written - falling back to another platform is simple as not displaying the touch UI by default for those platforms but leaving it available for those that have touch screens and the like (like the Surface) who want to use the touch interface.
     
  27. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    Sounds good! Let me know if you need any help.
     
  28. blockimperium

    blockimperium

    Joined:
    Jan 21, 2008
    Posts:
    449
    Looks like I have a couple of questions. Will help me figure out whether or not this will be very easy or somewhat complicated. I am trying to emit two events from the movement of an axis on a joystick. If the user have moved a little bit in a direction I want to generate one ACTION (i.e. WALK) and if they have pushed all the way to the edge generate another ACTION (RUN).

    This would seem to be something fairly common with axis based input controls, but its hard to tell how I would get that functionality with the way Rewired is currently setup.
     
  29. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    No, that's not the way Actions are used in Rewired.

    You would have "Move" and check in code the value of Mathf.Abs(player.GetAxis("Move")) to determine if you have a Walk or a Run. The input value could be used to determine the intended speed of movement (multiplied by your unit movement speed), then your transition from walk to run would either happen in code or through some other system like Mechanim.

    Rewired's Actions are not intended to replace game logic code. It's an input system that gives you values of input from the user, but you still have to use coding (or PlayMaker/Behavior Designer) to make decisions about what needs to be done based on the pure input values.

    Really, you have two different kind of actions: Input "Actions" and game logic "Actions". Walk/Run would be game logic. "Move" would be Input. Actions such as "Fire" may or may not be named identically to their game logic counterparts. Regardless, you have states and permissions to worry about in game logic code, but not in input. So even if input tells you "user wants to fire", if your game states/permissions say he can't fire, you don't process Fire. So even in this case, the input's Action "Fire" is not equal to the game logic action of "Fire".

    An easy way to think of it would be:
    Input Action "Fire" -- The user wants to fire.
    Game Logic Action "Fire" - Game character is firing.
     
    Last edited: Nov 10, 2015
  30. Rtyper

    Rtyper

    Joined:
    Aug 7, 2010
    Posts:
    450
    Hi guavaman,

    I've been using Rewired in a project for a few months now, and it's working really well for the input side of things. I just got started adding some more polish to it with vibration etc, and noticed references in the docs to the DualShock4Extension class, with the ability to control the lightbar on the back. I can't find any way of actually using this in Rewired though. The Rewired.ControllerExtensions namespace doesn't even seem to exist.

    Am I missing something obvious here? Thanks!
     
  31. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    Then you're not using the latest version of Rewired. Download and install the update from the asset store.
     
  32. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    @Rtyper

    Realize that you don't have to use the DualShock4Extension class for vibration. You can still set vibration the same way you can for an XInput controller using joystick.SetVibration and all the other function calls in the Joystick class.

    The special DS4 features are only available on Windows when using Raw Input with Enhanced Device Support enabled.
     
  33. MrMMatricks

    MrMMatricks

    Joined:
    Sep 22, 2014
    Posts:
    2
    Hello!

    I just realized that Input.controllers.joystickCount returns 1 controller, but only after a few update cycles. Is there any trick to force it to update itself sooner somehow?
     
  34. Rtyper

    Rtyper

    Joined:
    Aug 7, 2010
    Posts:
    450
    Nope, I'm definitely on the latest version, I updated from the asset store before I posted.

    Yeah I found the other vibration method, thanks :)
     
  35. blockimperium

    blockimperium

    Joined:
    Jan 21, 2008
    Posts:
    449
    Yeah that's the way I'm doing it now. I was just trying to short circuit/cheat the process by gathering that multivariate input from Rewired itself as a custom function of gathering input ;)
     
  36. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    If you're on the latest version, then the namespace is there. Just do this to set the light color:

    Code (csharp):
    1. public void SetDS4LightColor(Player player, Color rgb) {
    2.   foreach(Joystick joystick in player.controllers.Joysticks) {
    3.     var ds4 = joystick.GetExtension<ControllerExtensions.DualShock4Extension>();
    4.     if(ds4 == null) continue; // not a DS4
    5.  
    6.     // Set the light color
    7.     ds4.SetLightColor(rgb);
    8.   }
    9. }
    To verify you're using 1.0.0.75, check Window -> Rewired -> Help -> About.
     
    Last edited: Nov 10, 2015
  37. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    I get it, but there are many issues with that approach even if it could be done. For instance, how would you allow a user to remap their controls using this scheme? You show them 2 actions, Walk and Run, and then poll for axis input... There would be no way to really poll for Axis 1 +/- 0 to 0.5 = Walk, Axis 1 +/- 0.5 to 1 = Run. Anyway, you're doing it the right way.
     
    Last edited: Nov 10, 2015
  38. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    That's normal behavior on OSX. No, you can't force Rewired to update the controller list. Controller information is delivered by the OS by message when the OS is ready to deliver it. Rewired can't force a poll while the OS is waiting to respond. Perhaps El Capitan takes a little longer than previous OS versions on your system as in Mountain Lion, Mavericks, and Yosemite are all delayed about 1 frame after initialization usually.

    You should be using controller events to respond to changes in controllers in addition to running your code on Awake or Start to handle controllers that exist at start and ones that are attached/detached at runtime (or detected delayed as in this case).
     
    Last edited: Nov 10, 2015
  39. blockimperium

    blockimperium

    Joined:
    Jan 21, 2008
    Posts:
    449
    Yeah. Looking back on it, its was a really bad idea :)

    In trying to push that determination so far up the stack I was screwing up much of the multiplatform-ness of what I already had. Ah well. Seemed like a good idea...
     
    guavaman likes this.
  40. Rtyper

    Rtyper

    Joined:
    Aug 7, 2010
    Posts:
    450
    Yeah, sorry - not sure what was happening before, but the namespace wasn't showing up - now it is. Must be an issue with MonoDevelop. Thanks for the help!
     
  41. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    Okay, great!
     
  42. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    Rewired 1.0.0.76 is now available for registered users on the website. If you would like to receive access to early updates, please contact me here with your email address and Asset Store invoice number.

    Important new additions:

    Apple TV Remote:
    Apple TV remote now supports the accelerometer. Pitch and Rotate (-1 to 1) are exposed as well as user acceleration and gravity vector. Gyroscope data is not available because the Apple TV SDK does not expose this data.

    P.I. Engineering RailDriver:
    This version adds support for the RailDriver train controller from P.I. Engineering. (Windows only currently.) All features are supported including controlling the LED display and enabling/disabling the speaker.





    1.0.0.76:


    New Controller Definitions:
    - Linux Native: Nyko Playpad Pro
    - Amazon Fire TV: Nyko Playpad Pro
    - P.I. Engineering RailDriver (Windows only currently)

    Modified Controller Definitons:
    - Apple TV Remote (2015): Added Pitch, Rotate, Acceleration X, Y, Z, and Gravity X, Y, Z axes.

    Changes:
    - Added support for more Unity fallback joystick axes in Unity 5+ for upcoming tvOS support.
    - Optimized Unity fallback joystick button code for joysticks 5-8 in Unity 5+.

    API Changes:
    - Added ControllerExtensions.RailDriverControllerExtension
     
  43. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    372
    Wow, that train controller is amazing! Quite reasonably priced too..
     
  44. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,277
    It is a pretty cool device. :cool:
     
  45. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,541
    This is so amazing to have RailDriver support now. Now you can definitely say Rewired supports planes, trains and automobiles! :) For all those who are working on train simulations you have one of the only dedicated train controllers fully supported.
     
    guavaman likes this.
  46. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,541
    I did not realize how many youtube videos there are of this RailDriver controller also.
     
    Last edited: Nov 11, 2015
  47. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,541
    Thanks for this. I don't know how I missed this one the first time since it was flying related. :D
     
    Karearea likes this.
  48. PsyDev

    PsyDev

    Joined:
    Sep 30, 2015
    Posts:
    31
    Is there a way to tell what type of input the user has last used, in order to change helper icons on the fly?

    For example, many PC games support keyboard, mouse, and gamepad input in their UI simultaneously. If you press a gamepad button or move, then helper icons appear, something like O back for Playstation controller, B back for X360. If you move the mouse, any highlighted menu item becomes un-highlighted and helper icons disappear, and a mouse-clickable Back button appears. Now press a keyboard up or down, a menu item becomes highlighted, back button goes away, and you see an Esc back helper icon.

    Also the Pause button behavior changes depending on platform: PS4 vs Xbox, and I'm wondering if I should mirror that differing behavior when a PS4 controller is connected to PC. For example, on Xbox, Start to Pause, Start then acts as Enter when in the Pause Menu. If you drill down a few sub-screens, you must back out with Back or B button all the way to the top level Pause Menu, then another back unpauses. On Playstation, it's usually Start or Option button to pause, cross button to drill down into sub-menus, then at any time another Start/Option press unpauses, no matter where you are in the menu structure. Backing out with O circle button does not unpause.

    Hopefully that makes sense and you can advise whether you know if it's being done with Rewired.
     
  49. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Yes, I have that implemented in my game with Rewired.

    I posted my technique earlier in this thread (in January):
    http://forum.unity3d.com/threads/rewired-advanced-input-for-unity.270693/page-6#post-1918549

    You might come up with something a bit different, depending on how your game works, but that could get you started. It's been working very well.
     
  50. PsyDev

    PsyDev

    Joined:
    Sep 30, 2015
    Posts:
    31