Search Unity

  1. Unity 2020.2 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. gregorypierce

    gregorypierce

    Joined:
    Jan 21, 2008
    Posts:
    411
    @guavaman
    Awesome! I can build now. I don't know if its working or not (not next to the device yet - but since this is working I'm heading back to it right now), but I can get a build going. I'll let Unity know about the details of this thread for the defect so they can get this resolved. Will get back to you if it causes the Apple platform to now work properly.

    THANK YOU!
     
  2. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    Okay, great!

    I don't think it's necessary to point Unity to this thread. This issue is totally different from the import issue which is the real problem, even though it's only cosmetic. I've filed a bug report and told them how to reproduce it so it should be good.
     
    gregorypierce likes this.
  3. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    Update on this: Looks like it's a known Unity issue -- http://forum.unity3d.com/threads/un...ed-only-if-unity-is-set-to-autorotate.314542/
     
    Last edited: Dec 4, 2015
  4. Eskema

    Eskema

    Joined:
    Jun 23, 2010
    Posts:
    313
    (SOLVED)
    I finally loaded the mappings instead of a brute force load :)


    Hi,
    I'm trying to reset to default values but I'm unable to do it. I've implemented a small "config buttons" screen and it's working nicely, I've added the playerprefs components (as I just need a very simplistic save that's enough) and I can change the controls nicely.

    Now I'm trying to reset the values, so I go to playerprefs.deleteall(), and then (small delay) ReInput.userDataStore.Load(); but no changes at all... it's still showing my updated configuration changes instead of reloading everything from scratch.

    If I close the game and reopen it does the "load on start" and it loads all the default rewired values which is what I want, but not ingame.

    Am I missing something?
     
    Last edited: Dec 8, 2015
  5. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    Clearing PlayerPrefs and then calling UserData.Load isn't going to do anything. You're clearing all the saved data and then telling UserData to load maps from an empty database. It's not going to find any data in there, and therefore will not load anything, so it's not going to overwrite the existing maps in Players.

    If you just want to reload the default configurations for the currently attached devices, just call player.controllers.maps.LoadDefaultMaps. This will reload the default maps for that Player based on the configuration in the Rewired Input Manager. You can clear PlayerPrefs if you want all devices attached in the future to load the default values instead of the old saved values. You can do this for each Player. But of course, clearing PlayerPrefs will destroy any other non-Rewired data you have saved.

    UserData was designed for you to be able to store your data in any kind of data storage method you like by creating a subclass of UserData that implements your data storage system. PlayerPrefs has a ton of limitations and really isn't a great way of saving user data. If your game has more than the most basic needs of configuration, it's best to use a different storage method such as a database. This is up to you to implement as Rewired does not come with a database system.
     
  6. Eskema

    Eskema

    Joined:
    Jun 23, 2010
    Posts:
    313
    That's why I said solved at the beginning of the post :)

    I've found the loaddefaultmaps after posting. I thought that load will load the database and just as you said I thought it will load from the defaults if nothing was found, but that was not the case hehehehe.

    I know how S***ty playerprefs is, I never used it in a real project before, but in this case I don't want to waste time subclassing userdata just to store 4 keys, it's not worth the effort for my particular needs :)
     
  7. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    I know, but having an answer here might help someone else with the same problem.

    Okay, glad it works.
     
  8. Eskema

    Eskema

    Joined:
    Jun 23, 2010
    Posts:
    313
    You have an amazing tool and the api is so dense.... aka.. holy S***, it takes time to read all methods :p

    Hopefully someone else will stumble in the same mistake and this answer will help, thanks for your time :)
     
  9. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    :D

    Yeah. That's why I try to keep adding topics like this to the How To's page. I'll probably add this one there as well.
     
  10. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    Note: Due to changes in the beta, Apple TV support is broken in the current 1.0.0.76 with the latest 5.3.0p0. I will be fixing this today and hopefully publish 1.0.0.77 by the end of the day.
     
  11. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    Rewired 1.0.0.77 is ready for download for registered users. If you would like to register to get early access to updates, please contact me here. The Unity Asset Store should get this update in 5-10 days.

    1.0.0.77:

    Changes:
    - Windows: Added workarounds for issue where Steam Controller prevents non-XInput devices from functioning when attached. Optional: Can be set in Rewired Input Manager -> Settings.
    - DualShock4ControllerExtension: Exposed Dual Shock 4 touchpad data (currently for Windows only).
    - Custom Controller axes can now be set to uncalibrated to allow handling of values outside -1 to +1 range.
    - Improved Bluetooth controller connect/disconnect on Windows Standalone when using Raw Input.
    - Updated Apple tvOS support for Unity 5.3.0p0 beta.

    New Controller Definitions:
    - Thrustmaster Score-A
    - XiaoMi Wireless Game Controller


    Modified Controller Definitions:
    - Modified Apple TV Remote (2015) definition for changes in Unity 5.3.0p0 beta.
    - Added Mad Catz, Inc. Street Fighter IV FightStick TE to Xbox 360 controller definition.
    - Added Mad Catz Pro Flight Cessna Rudder Pedals to Saitek Pro Flight Rudder Pedals definition.

    API Changes:
    - Added ControllerExtensions.DualShock4ControllerExtension.maxTouches property
    - Added ControllerExtensions.DualShock4ControllerExtension.GetTouchId method
    - Added ControllerExtensions.DualShock4ControllerExtension.GetTouchPosition method
    - Added ControllerExtensions.DualShock4ControllerExtension.GetTouchPositionByTouchId method
    - Added ControllerExtensions.DualShock4ControllerExtension.GetTouchPositionAbsolute method
    - Added ControllerExtensions.DualShock4ControllerExtension.GetTouchPositionAbsoluteByTouchId method
    - Added ControllerExtensions.DualShock4ControllerExtension.Istouching method
    - Added ControllerExtensions.DualShock4ControllerExtension.IsTouchingByTouchId method
    - Added AxisCalibration.applyRangeCalibration property


    Bug Fixes:
    - Fixed issue when changing from Unity as input source to another input source at runtime.
    - Control Mapper now displays an Action's Descriptive Name with +/- appended if no Positive Descriptive Name or Negative Descriptive Name have been set.
    - Fixed bug in Rewired Input Manager where in rare circumstances two Actions in different Action Categories were allowed to have the same name.
     
  12. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,489
    Looks good.

    XiaoMi Wireless Game Controller is a new one. Have not heard of that company before.
     
  13. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    Rewired 1.0.0.78 is ready for download for registered users. If you would like to register to get early access to updates, please contact me here. The Unity Asset Store version will be updated after 1.0.0.77 goes live.

    1.0.0.78:

    New Controller Definitions:
    - Mad Catz C.Y.B.O.R.G. V1
    - Saitek Heavy Equipment Wheel & Pedals (Pro Farming)
    - Saitek Heavy Equipment Control Panel (Pro Farming)

    Changes:
    - Minor optimizations to fallback platform input code.

    Bug Fixes:
    - Fixed incorrect Controller.hardwareIdentifier on OSX Standalone platform
    .




     
  14. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
  15. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,489
    Maybe we get a two for one deal and get both 77 and 78 updates on the same day? :)

    This is great to have Saitek Farm Sim controller so soon after it was released! Keep up the good work on getting all of this fine controller hardware on native platforms. Only with Rewired.

    Just what @Karearea and @Steve Tack need for experimental aircraft ... a flying Tractor.

    http://www.polygon.com/2015/11/24/9791160/you-can-fly-a-starship-with-saiteks-farm-sim-controller
     
    Last edited: Dec 12, 2015
  16. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
  17. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,489
    That is so funny. Actually the farm simulator has some really interesting equipment in the game. They have 100 vehicles and tools in it. There one particular vehicle which I really like called the PONSSE Scorpion. Have you seen it before?

    Here it is how it is in Farm Simulator 2015

    Farming Simulator 2015 Ponsse Scorpion


    And here is the real life version ( I really like the controls)
    PONSSE Scorpion product video


    After seeing these videos it got me thinking about space mining. Something like the Williams 1982 Sinistar game where you were mining crystals as player. It would be cool to see a Ponsse Scorpion like device for mining small asteroids into reasonable pieces or finding other important minerals (e.g. gold) inside. With the Saitek farm simulator hardware you can purchase individual pieces (wheel and pedals, or the side panel or the entire package) so that would make it easy to get just the side panel.

    The farm simulator side panel is 25+ buttons plus the stick so Rewired is the only solution.

    I have seen a few examples [see the URL in my previous message (msg #1415)] of using Saitek X-52 and the farm simulator side panel in Elite Dangerous. I can easily see 4+ usb game controllers easily. Thankfully with Rewired's Control Mapper it makes it handling player's in game remapping preferences easy.

    So many possibilities and I am glad Rewired does all of the hard work so I don't have to worry about it.
     
    guavaman likes this.
  18. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    I really like that idea! Makes me think of the possibilities of a StarCraft SCV game where you play the role of the support crew instead of the military commander. You could even do some fun stuff with Zerg "vehicles."
     
  19. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,489
    I can see some interesting local multi-player ideas with that. So can we expect @guavaman new space mining game this week? :):):)

    NASA has some interesting things on that topic too ...

    http://www.asteroidmission.org/mission/
     
  20. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,489
    Actually Star Citizen might be more interesting to you with regards to mining options.




    This part talks about more as profession which sounds like what you were interested in.

    https://robertsspaceindustries.com/comm-link/transmission/14522-Star-Citizen-Careers-Mining
     
  21. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    :D Just need about 50 clones of myself made, then sure!

    The NASA link is very cool. Nice presentation.

    Wow, Star Citizen's implementation sounds far more interesting. Though personally, I'd go for something a little less detailed and realistic and more game oriented. I don't want to have to get a PHD in laser mining and read 50 instrument panels to be able to play competently.
     
  22. Mahdi-Jeddi

    Mahdi-Jeddi

    Joined:
    Dec 21, 2012
    Posts:
    27
    I have a problem:
    I connect multiple gamepads (XBONE and DS4) and change the mapping category based on different situations, but it only changes the mapping for the first gamepad, and the second gamepad doesn't work in those situations. I use this code to change the mapping:
    var player = ReInput.players.GetPlayer(0);
    player.controllers.maps.SetMapsEnabled(state, categoryId);

    I also do this in startup to load the mappings:
    player.controllers.maps.LoadMap(ControllerType.Joystick, 0, 2, 0, false);
    player.controllers.maps.LoadMap(ControllerType.Keyboard, 0, 2, 0, false);
    player.controllers.maps.LoadMap(ControllerType.Mouse, 0, 2, 0, false);
    foreach (ControllerMap map in player.controllers.maps.GetAllMaps())
    map.enabled = (map.categoryId == 0);

    I tried everything, even loading the mappings every frame, but it doesn't work when I start a new level. Am I doing something wrong? Or is this s a bug? Why do I even need to load the mappings? Shouldn't they be loaded in startup anyway?
     
  23. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    To which Player(s) are these joysticks assigned?

    Rewired, if using auto-joystick-assignment and the default settings, will not assign 2 joysticks to a single Player. If you want to do this, you must set the Max Joysticks Per Player to more than 1.

    If these joysticks are assigned to multiple Players, you must make your calls on each Player in which you wish to change map settings.

    Controller maps are always loaded at start or when a controller is attached, but only enabled if you have that controller map set to start enabled in the Player in the Rewired Input Manager. See step 16 of the Quick Start guide.

    The only other thing that could cause Rewired not to be able to load the default controller maps is if you're overwriting them by loading saved XML data. This would happen if you're using UserDataStore_PlayerPrefs to save and load XML.

    There are no known bugs in the controller map loading system.

    You mention in passing "when I start a new level." Is this issue only happening when loading a new level at runtime? How are you dealing with the Rewired Input Manager when loading a new level? Is "Don't Destroy on Load" checked in the inspector? Are you loading over an existing Rewired Input Manager in the new level?
     
    Last edited: Dec 14, 2015
  24. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    Rewired 1.0.0.78 is now live on the Unity Asset Store!

    1.0.0.78:

    New Controller Definitions:
    - Mad Catz C.Y.B.O.R.G. V1
    - Saitek Heavy Equipment Wheel & Pedals (Pro Farming)
    - Saitek Heavy Equipment Control Panel (Pro Farming)

    Changes:
    - Minor optimizations to fallback platform input code.

    Bug Fixes:
    - Fixed incorrect Controller.hardwareIdentifier on OSX Standalone platform.
     
  25. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,489
    Wow! It is nice to see the asset store turn around so quickly and get this released. :)
     
  26. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    Agreed! Especially so close to Christmas!
     
  27. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    Regarding the message that was posted and deleted about tvOS:

    This is a Unity error that occurs when you build to tvOS with XCode 7.2 and not related to Rewired in any way. The code in question is generated by Unity. Unity is aware of the error and will be fixing it in the next release.

    Rewired does not output any native code on iOS or tvOS. It is fully managed C# code.
     
  28. DNArt

    DNArt

    Joined:
    Jan 16, 2014
    Posts:
    21
    I have a question.
    Since rewire has such a great Universal platform support i wondered

    Would it be possible to use an arduino or any other microcontroller as an IO controller? ( probably over bluetooth )

    The plan is actually to misuse that connection also for simple communication like switching on a lightbulb etc.
    I did see a special Arduino plugin but it seems very platform specific.
    Does anyone has an idea about this ?
     
  29. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,489
    But it sounds more like you want a usb device to drive output. Where the output could be anything (LED display, Lights, etc.). Rewired is for Input and not Output.

    In my quick search of the unity asset store the Arduino plugin claims to supports both input and output on PC/MAC and comes with full source code. You should contact that vendor and see if product supports the platform you are looking for. If you wanted something for more general case to handle any type microcontroller that sounds like you get to write a large amount of custom firmware and protocol engine to handle the bluetooth to handle what you need.

    Rewired is for Input.
     
  30. Justin-Wasilenko

    Justin-Wasilenko

    Joined:
    Mar 10, 2015
    Posts:
    85
    I'm looking to map a button on a controller, to reproduce the onClick event in the Unity UI on a button. I'd like to push button X on the controller and have it register as 'onClick'

    I followed the instructions here, but didn't really help me, I had no StandAlone Input module in my scene anyways because it's a Google Cardboard game.
     
  31. Mahdi-Jeddi

    Mahdi-Jeddi

    Joined:
    Dec 21, 2012
    Posts:
    27
    @guavaman Thank you for the response!
    As you said, The problem was that I had to add more maps to the player so that it would load the new categories. But all this was a little bit too complicated in my opinion! ;)

     
  32. Mahdi-Jeddi

    Mahdi-Jeddi

    Joined:
    Dec 21, 2012
    Posts:
    27
    For faking a click I use this in code:

    button.OnPointerClick(new PointerEventData(EventSystem.current));
     
  33. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    That's why the Quick Start exists, to walk you through the process and get your familiar with the concept of using controller maps. If you want the power of a general-purpose, player-based, cross-platform, AAA input system, it's a given that it's going to be slightly more conceptually complicated than a system that can't do all of what Rewired can do. Once you "get" the concepts of controller assignment to Players and how controller maps work, it's not that complicated. (This essential page of the documentation is required reading and explains it all.) After you're comfortable with the concepts, the implementation of game input is actually far simpler than most typical input systems, especially for multi-player games or cross-platform games requiring little to no platform-specific or device-specific code.

    Rewired should never be jumped into without reading the documentation thoroughly, especially if your needs go beyond the basics such as when you want to use the controller map system to enable and disable maps at runtime.
     
    Last edited: Dec 16, 2015
  34. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    That's not what Rewired is designed for. Rewired provides an interface to an identifyable input source with a fixed set of inputs (and some output) for joysticks/controllers, keyboards, and mice -- it only works with those device types. Something like Arduino is too open-ended because you can program it to do pretty much anything. Rewired is not a C# API to allow two-way communication with any arbitrary device through the HID interface. Many devices still require their own SDK. I have to manually program code for each specialty device that is supported at a low level such as the DS4 or the RailDriver and write the public interface for that. Rewired does not provide a user-customizable generic low-level HID programming interface.

    The only way I can see you using Arduino with Rewired is with the use of a Custom Controller, but that would only provide input support, not output.
     
    Last edited: Dec 16, 2015
  35. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    As @Mahdi Jeddi said, you're going to have to fire the event yourself. The StandaloneInputModule is used to react to events from mouse, joystick, and keyboard input. If you don't want to use that module, or your want to change the way the module reacts to input such as making a joystick button act as a mouse click, you're going to have to implement your own input events for Unity's UI. This is outside Rewired's responsibility. Rewired can provide you with the value of the button easily through player.GetButtonDown("MyAction") and you can use that to drive the OnClick event.

    However, if you're making a UI that can be controlled by a joystick, why not just use the StandaloneInputModule/RewiredStandaloneInputModule? They're designed for allowing you to control the UI with both mouse and joystick. When you press a joystick button, you don't get an OnClick event, but you get an OnSubmit or an OnCancel event instead.
     
  36. DNArt

    DNArt

    Joined:
    Jan 16, 2014
    Posts:
    21
    @longroadhwy Thanks for your quick response. I did read there was a problem on a Mac with the arduino module also many platforms are not supported and rewired works so well. I hoped the vibrating of the controller would be controlled by output. It was not intended for general use but a specific project of a student with close to 0 technical experience but she needs 1 input and 1 output. Probably connecting some wires to a supported controller would be the easiest way to go than for her.
    @guavanam
    Thanks for replying so quick. I fully understand that not what it is designed for. thanks for the info on having no user-customizable generic low-level HID programming interface. That makes it a no go for me.
     
  37. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    You're welcome. It's not the right tool for your purpose. It's a common misconception that because Rewired supports next to every controller type and implements native input that it can be used for any and every device type including those that require custom SDKs or other special low-level handling.
     
    Last edited: Dec 17, 2015
  38. Justin-Wasilenko

    Justin-Wasilenko

    Joined:
    Mar 10, 2015
    Posts:
    85
    This is what I have tried to setup, I have the RewiredStandaloneInputModule in the scene and setup it up following the instructions, but when I click, I don't seem to get any result from the OnSubmit, I'm guessing I've done something wrong then.
     
  39. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    1. Did you follow these directions for setting up the RewiredStandaloneInputModule?
    2. Do you have an Event System in your scene and enabled?
    3. A mouse click returns OnClick, not OnSubmit. OnSubmit is only used by buttons/keys that activate the button.
    4. For keyboard/joystick input, you must set up a Keyboard/Joystick map, have that map assigned to a Player and set to be enabled on start, and have that joystick (if using a joystick) assigned to a Player.
    5. What build target is this?
    6. Is this in the editor or in a build?
    7. What options do you have set in the RewiredStandaloneInputModule inspector?
    8. Have you created the appropriate Actions in the Rewired Input Manager that match the Actions you've set in the RewiredStandaloneInputModule for controlling the UI? (Show your Rewired Input Manager page screen shots - Joystick Maps, Keyboard Maps, Players, Actions)
    9. Do you have any other StandaloneInputModule in the scene that is also enabled?
    10. Have you tried using the normal StandaloneInputModule instead and what results do you get?
    11. Are you already familiar with working with Unity's UI system or is this the first time you've tried to use it? RewiredStandaloneInputModule assumes familiarity with Unity's UI system and how everything works as it's just a slightly modified StandaloneInputModule that pipes input from Rewired instead of UnityEngine.Input.

    There are just so many variables that could be wrong here and little information I have about your setup that it's almost impossible to give a complete list. It would be far easier to figure out your problem if I could see your project. Contact me on the website with a link to your project if feasible.
     
  40. robc

    robc

    Joined:
    Feb 15, 2010
    Posts:
    13
    Hey all!

    I recently started integrating Rewired into a project, and I've really been satisfied with how easy it was to integrate and get input up and running quickly - so wanted to say thanks for an amazing package all up!

    Regardless, I've got a couple of questions (and an issue) based on my initial usage and some devices I'm wanting to support on the projects I'm using it for...

    For MFI pads under iOS/OS X, I found to use a Steelseries Nimbus, I had to set up its own controller map, instead of relying the "iOS MFI Controller" one. Is this something I need to do for each MFI controller I want to support on OS X, or will there be a generic MFI controller profile on the Mac as well?

    Secondly - I was wondering if there are plans to enable rumble on pads for OS X? I know the 360Controller driver supports it, and I'd love to be able to implement support for it in games (or is there some limitation I'm not aware of which prevents it)

    Finally, I found when testing a Saitek X52 Pro, that it was failing :( It turns out it's because it wasn't matching against the X52 profile as the Pro offers 5 additional buttons that I've detailed below (as returned via JoystickElementIdentifier on OS X).

    * Button 34: Function Page Up
    * Button 35: Function Page Down
    * Button 36: MFD Select Up
    * Button 37: MFD Select Down
    * Button 38: MFD Select Click

    What's the best way for me to be able to get support in? Give you an initial hardware mapping (I can really only do it under OS X) for you to complete? I'm not sure sending the controller over is an option, as I'm over in Australia and it'd massive expensive to ship the stick over ;)

    Many thanks!
     
  41. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    Thanks! Glad you like it!

    Just use the Dual Analog Gamepad Template. Far easier. Covers every recognized gamepad and you only have to map it once.

    There is no generic MFI controller profile on OSX because there is no way to programmatically identify the fact that it is an Mfi controller from the returned HID data. iOS is different.

    It's one of 1,000 things on the to-do list. But because the device is not a true standard HID device, it will have to have a custom "driver" written for it to set vibration. It's not high on my priority list at the moment. Supporting vibration through OSX's force feedback library would limit it to one single motor, which is not a proper solution in my opinion.

    I was under the impression that the two devices were identical in terms of the elements. If this is not the case, I will have to look into it.

    I think the best solution (and probably cheaper! : ) would for me to buy a Pro and add a separate definition for it. It's not really feasible for you to create the mappings on all the platforms Rewired supports. I won't be able to do this before the holiday season is over however unfortunately.
     
    Last edited: Dec 18, 2015
    robc likes this.
  42. robc

    robc

    Joined:
    Feb 15, 2010
    Posts:
    13
    Awesome. I must have messed up something when I was configuring it, so I'll go over it again on my end.

    Cheers. I was wondering if it was down to needing a lot more custom code - didn't know Apple's framework only handled a single motor, so that's a bummer. Thanks for letting me know it's on the todo list, I'm happy enough to know it'll come eventually :)

    Thanks for that too - it was tough actually working out what the difference was - and missed the button count mismatches on a few occasions. I think that delay's more than fine - worst case scenario, I'll recommend the person I'm working with gets on your list for getting the downloads ahead of the Asset Store releases.

    Thanks for the quick feedback!
     
  43. robertwahler

    robertwahler

    Joined:
    Mar 6, 2013
    Posts:
    43
    I'm having trouble with Apple Siri Remote support on the tvOS beta from Unity 5.3.0. I'm using Rewired 1.0.0.78.

    The Siri remote will only work if I create a joystick map specifically for it. The default dual analog mapping doesn't work. I'm not sure how to trouble-shoot. At this point, I thinking of using native Unity support on tvOS since that seems to be pretty solid and has extra support for the tv operational modes (http://forum.unity3d.com/threads/official-unity-for-apple-tv-open-beta.371324/)

    BTW, Unity 5.3.1 was just released today with official tvOS support. I have not tried it yet to see if that fixes my issues.
     
  44. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    That's because the Siri remote is not a dual analog gamepad and is not covered by the template. The Dual Analog Gamepad Template only includes support for the gamepads listed here.
     
  45. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    I'll try to let you know when this is implemented.

    Thanks for finding this. It will help a lot of people making flight/space games.
     
  46. robertwahler

    robertwahler

    Joined:
    Mar 6, 2013
    Posts:
    43
    I see. Thanks. I saw the remote listed at the bottom of the page but didn't notice the left hand column header had change from "gamepad" to "remote". I guess I figured the remote could have a standard mapping for at least the D-pad, X, and A/Menu buttons but the custom mapping makes perfect sense to me now.

    Another related issue.

    The SteelSeries Nimbus is listed in the gamepad section. It works great on OSX. It connects with the name "SteelSeries Nimbus" on OSX but on tvOS is connects as "Controller". Sometimes GetButtonDown() on player 0 works and sometimes it doesn't. Maybe the remote is squatting on Player 0? If the Nimbus does work, I have to turn it off to get the Siri remote to respond to GetButtonDown() on player 0. I'd like to use both the remote and the controller for GetButton events. I suspect that I'm just using the API incorrectly. Is there a way to call GetButtonDown on any player/controller?
     
  47. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    That is because all Mfi gamepads are treated as a single type in iOS. They are not identified by name, but rather type (basic, extended, etc.) On OSX, they cannot simply be identified by type. Instead, you must match the Product Id/Vendor Id for each Mfi device up to a controller definition.

    That's not a problem with the Nimbus or the remote. It's a matter of controller assignment.

    Rewired (by default) assigns controllers to Players when detected based on your settings here:
    http://guavaman.com/projects/rewired/docs/RewiredEditor.html#Settings

    Joystick Auto-Assignment:
    If you have 1 Player, by default, only 1 controller will be auto-assigned to it. If you want to use more than 1 controller at the same time for the same Player and use auto-assignment to achieve this, you must raise the Max Joysticks Per Player value or assign the controller yourself via scripting on connect.

    If you have multiple Players, by default, Rewired will assign one controller to each Player in order as they are discovered.

    All of these Joystick Auto-Assignment settings are optional and configurable. These are simply the default settings that come with Rewired.

    Controller maps and simultaneously controller assignment are explained in the documentation here:
    http://guavaman.com/projects/rewired/docs/ControllerMaps.html

    To assign joysticks manually, see:
    http://guavaman.com/projects/rewired/docs/HowTos.html#assigning-joysticks

    This issue comes up often enough that I am going to make a separate Controller Assignment section in the documentation under Concepts. (Edit: The new documentation on Controllers is here.)
     
    Last edited: Dec 18, 2015
    robertwahler likes this.
  48. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    4,481
    Another reason you wouldn't want to map the Siri remote with the Dual Analog Gamepad Template is it wouldn't support mapping Tilt, Rotation, or the accelerometer or gravity vectors.
     
  49. S_Darkwell

    S_Darkwell

    Joined:
    Oct 20, 2013
    Posts:
    318
    I just stumbled across what I suspect may be a bug:

    When the target build setting is set to "Web Player", Xbox 360 controllers fail to detect OnButton / OnButtonDown while both triggers are being held down simultaneously, even when "Windows: Use XInput" is enabled.

    Additionally, "Windows: Steam Raw Input Fix" cannot be unchecked.

    This is of no immediate concern to me, but I wanted to make certain you were aware.

    Thank you and be well!
    - S.
     
  50. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,489
    What version of Rewired are you using? What operating system are you using? What version of Unity are you using?
     
unityunity