Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Rewired - Advanced Input for Unity

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

  1. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    @guavaman alright cool! Thanks for such a quick reply :)
     
  2. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,608
    The sale is over.
     
    Last edited: Mar 6, 2017
  3. Jasinka

    Jasinka

    Joined:
    Oct 18, 2016
    Posts:
    50
    Thank you for discount and great product!

    I wanna ask about installing... My game is very simple touch screen game.
    Installed plugin * add player * add action (move left/right, move up/down) * add joystick map * selected unknown controller. Controller - gamesir g4s
    An added your script to "player".

    And still don't working. What i missing?
     
  4. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    More information is needed ...

    What version of Unity are you using? (32-bit or 64-bit)
    What operating system are you using?
    What version of Rewired are you using?
    What platform/OS are you targeting with the build?
     
  5. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,608
    Please see these Troubleshooting topics:
    My controller doesn't work
    Joystick control doesn't work

    The information there should help you solve the problem.

    Be aware that making a map for Unknown Controller will have unpredictable results because you cannot know which axes or buttons on an unknown controller will be which.

    The GameSir G4S is an XInput compatible gamepad (switch it to XInput mode if it has a switch), so you should be able to just create a controller map for the Dual Analog Gamepad Template and everything will work, assuming you're using Windows and that you have Use XInput enabled.

     
    Last edited: Mar 4, 2017
  6. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    Must say I am impressed I was told about Rewired by longroadhwy who has recommend it quite strongly :) I have 2 Saitek X 36's (Both the Gamport and USB Versions), Saitek X45 USB, Thrustmaster Attack Throttle H.O.T.A.S with the Top Gun, Thrustmaster F16 TQS and FLCS Gameport Joystick , After burner 1, 2 and the force feedback versions USB, and the Thrustmaster TFlight X HOTAS USB joysticks and this will hopefully help me program my Planetary Game which will be like a Battlezone/Freespace/Wing Commander F..P.S.R.T.S games where you fight and conquer on different planets and moons throughout the Solar System , Hopefully further games in the series could be made untimaltely through war and trade you can become a Universal Emperor but that would be for the 3rd game first two its becoming a Solar SSytem Emperor and an InterGalactic Emperor .

    I did a few months ago get the joystick to work on my Windows Vista System but having trouble with me Windows 7 system especailly as I am using it with another Asset Package which is C.G.F (Circular Gravity Force) I haven't tried it without yet but I think its more a problem with with the Unity update not the packages , hopefully this will help I have downloaded the demo but I am having difficulty making it link up in Unity (i.e getting the controls to work in Unity) as I wish to have the tanks controlled with Joystick H.O.T.A.S So I think I need some with this please? And yes I am looking to buy the full version as sorry but the Joystick Unity controls are .well weak ?




    N
     
  7. guavaman

    guavaman

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

    Your game sounds intriguing! I'm not sure at what point in the process you are having difficulty. "Getting the controls to work in Unity" could mean many different things.

    The best thing to do is to 1) Follow the Quick Start tutorial to get a feel of how Rewired is to be set up and used. 2) If something doesn't work, follow the guides in the Troubleshooting section to determine why:
    Be aware that only two of the devices you listed have extended support (auto-recognition and mapping): http://guavaman.com/projects/rewired/docs/SupportedControllers.html

    The other two would have to be mapped by the user in-game using something like Control Mapper. Devices that do not have extended support cannot use the Templates such as the HOTAS template. This is explained here: http://guavaman.com/projects/rewired/docs/ControllerMaps.html#controller-templates
     
    Last edited: Mar 4, 2017
  8. Marrt

    Marrt

    Joined:
    Feb 7, 2012
    Posts:
    613
    Hi, seems like a must-have-asset to any game that might use gamepads

    How are Gamepads detected? By some hardware-id that you fetch through special dlls or just by Input.GetJoystickNames (which i cannot imagine to be sufficient)
     
  9. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,608
    It depends on the platform and input source(s) chosen. Some platforms only use UnityEngine.Input, some use native input libraries. It's always your choice what you use. From the website and UAS Page:

    Native Input
    Rewired is not just another Unity input wrapper like other packages. Rewired supports many platforms that Unity supports with extended native support on Windows, OSX, Linux, Windows 8 Store, Windows 10 Universal, Ouya, XBox One[2], and PS4[2]. Rewired leverages native libraries to access input devices directly, allowing for far more control over input. This makes possible some very powerful features such as full hot-plugging support for joysticks and support for more than 20 buttons per controller. Rewired is the only input system available for Unity with native support for these platforms and the only one to offer these advanced features. For other platforms, Rewired utilizes Unity's input system so you still get access to all the other features it provides.

    From the website, the list of platforms:

    Rewired has been tested on the following platforms. Others may work but have not been tested.
    • Windows Standalone 32-bit/64-bit*
    • Windows Webplayer
    • Windows 8 Store*
    • Windows 10 Universal 32-bit/64-bit (.NET and IL2CPP)*
    • OSX Standalone 32-bit/64-bit/Universal*
    • OSX Webplayer
    • Android
    • iOS
    • Linux*
    • Sony PSM (Sony PlayStation Vita)
    • Sony PlayStation 4* [2]
    • Microsoft XBox One* [2]
    • OUYA*
    • Apple TV (tvOS)
    • Amazon Fire TV
    • Google Nexus Player
    • Razer Forge TV
    • GameStick
    * Platform features Extended Native Support

    One platform may have multiple input source options. For example, Windows has the option to use Unity, Direct Input, Raw Input, or SDL2. If using Direct Input and Raw Input, XInput is then another secondary input source option.

    The supported controllers page lists the recognized controllers and more information about compatibility.
     
    Marrt likes this.
  10. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Wow that is a large number of controllers. It is hard not to get excited about HOTAS systems. :) Plus you mentioned BattleZone. :D

    @guavaman @Vampyr_Engel

    This is one problem originally posted in this thread but I am re-posting here to provide some additional context. https://forum.unity3d.com/threads/c...ship-or-aircraft-cockpit.455223/#post-2981120.

    Let's get the Saitek X-45 and ThrustMaster T.Flight Hotas X done first since those are already in Rewired.

    For these two joysticks Saitek X-45 and ThrustMaster T.Flight Hotas X then Rewired HOTAS Template should work fine. Since those controllers are already known by Rewired. I talk a little bit about the Rewired HOTAS minimum subset in this message.

    https://forum.unity3d.com/threads/rewired-advanced-input-for-unity.270693/page-56#post-2953481

    The Rewired HOTAS template subset of components I have been using currently are: Stick X, Stick Y, Trigger, Stick Button 1, Stick Button 2 (also map the pinky on higher end sticks to match Stick button 2), and HAT1.

    (A) Joystick POV
    For Joystick POV (use the HAT1 in the Rewired HOTAS template). You have my example in the other thread for reference https://forum.unity3d.com/threads/c...ship-or-aircraft-cockpit.455223/#post-2957041

    (B) Forward and Reverse
    For forward and reverse movement (Rewired HOTAS template). Stick Y will cover that.

    (C) Horizontal Movement
    For Horizontal movement (Rewired HOTAS template). Stick X will cover that.

    (D) Rudder/Strafing

    Not entirely sure of the context of this. Are you talking about the twist option on some joysticks which is used instead of having physical rudder pedals?

    If so then in the (Rewired HOTAS template) Stick Rotate will handle that.

    Also if you want users to be able to use Flight Rudder Pedals. You can also map the Flight Pedals template so your customers can use that also. CH FighterStick and ThrustMaster warthog do not have twist option and require flight pedals.

    ======

    Rewired Hotas Template (tip).

    When you create a joystick map you should also click on the "Create Defaults" button at the bottom. That way you can see all of the options available for mapping. Not everything applies to all joysticks but it will give you a good idea of what you have available for mapping. With HOTAS that means many wonderful options.

    NOTE: This works for all maps not just templates. It makes it easier to find stuff that should be mapped but got missed too.

    See Exhibit A for a screen shot and the "Create Defaults" button circled in blue for reference.


    Exhibit A:

    Rewired_HOTAS_templates.JPG
     
    Last edited: Mar 5, 2017
  11. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,608
    Thank you for providing more clarity about @Vampyr_Engel's problem. That post in the other thread makes the issue clear.

    The issue you are facing is one of joystick recognition. From the Controller Maps page of the documentation:

    -----------------
    Joystick Maps:

    When a controller (excluding mouse and keyboard) is attached to the system, Rewired will attempt to identify that controller and load a hardware definition. When the Joystick is assigned to a Player, it will load Joystick Maps into the Player if you have created any Joystick Maps in the Rewired Input Manager that are compatible with that controller. (You can see the the current list of recognized controllers with extended support here.)

    If you want your players to be able to plugin in a controller and have it "just work", you should create a Joystick Map for each controller you want to explicitly support. To save time, you can create a Joystick Map for a Controller Template that includes the controller you wish to support.

    Joystick input returned by a Player is determined by the buttons and axes bound to Actions in one or more Joystick Maps assigned to a Player. When a button or axis is activated that is bound to an Action, the Player will return a value for that Action. You create these maps in the Rewired Input Manager and assign them to each Player and they will be loaded at start. You can also enable, disable, remove, add, load, and save Joystick Maps at runtime.
    --------------------


    The problem is, you have a number of controllers that are not recognized by Rewired and therefore they can only map as Unknown Controller. This is also addressed in the Controller Maps page of the documentation:

    ----------------------
    Unknown Controllers:

    For unrecognized controllers (controllers not listed here), Rewired will use the Unknown Controller map (whether you define a map for this or not). This is a generic map that is just a sequential list of axes and buttons, each corresponding to an axis and button on the controller in the order they are defined by the controller hardware. You can create a map for Unknown Controller if you like, but there's no way for you to know which axis or button corresponds to which element on the controller the user plugs in, so it's generally better just to leave it without a map and provide the user with a remapping screen where they can set up their unknown controllers how they see fit. See Creating a Controller Mapping Screen for more information.

    Note that even though a controller is unknown to Rewired, XML mapping data can still be saved and loaded for these controllers. This means that if your users make custom control mappings for unrecognized controllers, they can still save their configurations and continue off with the same controller layouts after quitting and restarting the game. All saving and loading of controller data is up to the developer to implement. See Saving and Loading Controller Maps for more information.
    ---------------------------


    You cannot create default mappings for unrecognized controllers and be able to know what element is what. Unrecognized controllers are always best handled by letting the user map their controls themselves in game.

    There are 3 possible approaches to dealing with unrecognized controllers:
    1. Provide the user with a control remapping system such as Control Mapper and let them map their controls.
    2. Create an Unknown Controller map. This is not very useful for something as complex as a HOTAS system.
    3. Create hardware definitions for your devices so that you can then create mappings for specific elements. The documentation discussing this topic is on the How To's page here.
    The information @longroadhwy provided about controller Templates is useful and correct. It's easiest to start with a Template and it gives you coverage of all current supported devices and future ones as they are added. However, the template cannot work with unrecognized devices. Documentation on controller Templates is here on the Controller Maps page of the documentation.
     
  12. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    [
    Oh yes I am a great fan of Batlezone from the green 3d vector green line game right up to the R.TS and even the new VR version I am nuts about Battlezone but I want my homage to have fights in Space as well as I am a fan of the Wing Commander Series and Freespace plus Elite although I don't have Elite Dangerous yet and yes I play the Battlezone Series especially the Battlezone R.T.S series (which includes the Redoux 98 and Red Oddessy ) with my H.o.t.a.s Joysticks.

    Now strafing is usually done using the rudder controls on the Saitek X45 or Thrustmaster T.Flight X HOTAS ( Those are the paddles fixed on the throttles which was invented by Saitek , it was for those players who couldn't afford or the get Rudder Pedals as I think Saitek weren't making pedals at the time and Thrustmaster was) One thing though why is the throttle Sick Y when most games have it either as Joy U axis or Joy Z Which the Saitek X45 uses The Thrustmaster Afterburners Series uses the Joy U axises ) And with the New Saitek sticks like the X52 right upwards you can use the twist rudder option as they don't have the Rudder paddles on the throttle anymore they don't wish to give a choice I question the CEO of Saitek years ago on a forum and they stupidly and arrogantly didn't wish to give people a choice of having both like Thrustmaster had on the Afterburner , They wanted it Twist Rudder Only hence I refuse to buy anymore products of theirs after the Saitek X45, after all Thrustmaster does offer this choice right up to the latest T16000M H.O.T.A.S And yes I would like the pedals as well this time .



    So I may if I can get a bit of cash get that , Though one thing I wish they would put the old choice button that you could control whether you could control rudder control from either the Joystick or the Throttle as they did on the old Afterburner as sometimes you get caught out on the T Flight X H.O.T.A.S) I think I will take peoples advice and just use the templates as doing a custom might not be a good idea besides I want the player be able to control his hover and hovercraft tank the way it is in Battlezone 9I guess you have played so you know how it works ) and really its the standard Quake /FPS movement but with a joystick H.O.T.A.S system.

    I guess I will just have to learn how to use the package so I can implement it for Jump Space Planes as well oine thing though I hope I can still use the mouse and keyboard as you can in Emporium Galactic Survival and the reason I brought that game up is 1) It uses the Unity Game Engine and 2) It has the same controls for your hover vehicle well you can set the controls up that way anyway
     
    Last edited: Mar 7, 2017
  13. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    Thank you very much for replying guavaman the thing is I only have my Saitek X45 inputted I didn't make it clear I have two PC's one that rund Windows Vista Home Premium and one that is running Windpws 7 and it wthe Windows 7 I ham having problems with at the moment though I can't think why as it runs OK with most applications (after installing n Windows 7 Drivers for it) I have been looking at your video tutorials on Youtube and I shall try again as well as I did just use a demo assest and I may have to import Rewired for it to actually work if I get any more problems I will let you know . Once again thanks for the hard work you have done working on this problem of Unity
     
  14. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,608
    I suggest you check the Debug Information in the Rewired Input Manager inspector as mentioned in this Troubleshooting topic which I linked above. You will easily be able tell whether this is a joystick recognition, mapping, or assignment problem. Check the Joystick under Controllers and see if it's being recognized. Drivers can and do have an effect on what a device appears as to Rewired.
     
  15. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    Well I got everything (except controlling the 1st person camera ) witrh the Spaceflight controls example using the Standard and Rewird Joystick control's but I think to use the Joystick POV for the camera to look around I would need to have it in the script is thactr correct?
     
  16. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    @Vampyr_Engel

    Yes. You have my example in their other thread for Joystick POV as a reference.

    Only played with the original Arcade version of Battlezone and none of the other variants made later on.

    The CH Products Eclipse Yoke also has rudder paddles on it. That is CH Products' only product that has paddles since they have been selling their products for a long time and includes rudder pedals. Unlike Saitek (which is now part of Logitech) in real life CH Products also makes joysticks for commercial, defense and industrial use.

    Probably just a naming convention for those particular games since the game does not know what is the name of the axis but just that an axis exists. That is basically like the unknown controller that @guavaman was talking about. At least with the most popular controllers Rewired has all of the individual usb elements named so it makes it easier to work with.

    Some throttles have a mini-stick (X and Y axis) on them which people really like for space games like Elite Dangerous. CH Products' Pro Throttle, Saitek X-55 throttle, ThrustMaster TWCS Throttle are examples of that have a mini-stick (or mouse like stick) on the throttle.

    This is a screen shot based on message posted for Elite Dangerous ... but that is an example of the CH Pro Throttle setup for the mini-stick. See Exhibit A:

    Exhibit A:

    CH_products_mini_stick.JPG


    Historically most games only supported one controller in game. So CH Products have a software product to make multiple of their USB products appear as one product. So you can have all three devices CH FighterStick, CH Pro Throttle, and CH Pro Pedals appear as one usb device to the Windows. At least in most modern games that is not usually a problem any more.

    In Rewired make sure you have multiple usb controllers allowed per person because each player may have multiple. I usually use 20 so that should be able to handle almost anything that a user has for flight sim. See Exhibit B:

    Exhibit B:

    Rewired_max_joysticks_per_player.JPG



    I have not played the Battlezone 9 variant. You can alternatively map individual controller instead of using the template if you wish. It can be time consuming mapping each controller.

    You can definitely include keyboard/mouse/controller all at the same time easily. That is one of the my many reasons I like Rewired. My Joystick POV example (in the other thread) had keyboard/joystick example setup.
     
    Last edited: Mar 7, 2017
  17. Maverick

    Maverick

    Joined:
    Dec 18, 2009
    Posts:
    240
    Hi,

    Can Rewired work together with Physics Raycaster? I need Pointer Enter, Pointer Exit events and I couldn't find a way to do it in Rewire.

    Could you please advice?

    Thanks.
     
  18. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,608
    Unity Events are sent by the input module you're currently using. Rewired comes with a modified StandaloneInputModule, the RewiredStandaloneInputModule. It does everything the StandaloneInputModule does except it uses Rewired for input. Mouse events are unmodified and are sent using Unity's mouse position and click information since Rewired cannot and does not modify the position of the hardware cursor.
     
    Last edited: Mar 7, 2017
  19. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,608
    I'm a bit lost here. Are you using some pre-built Rewired scripts for controlling things you got from somewhere? Because if you're building your own control scripts, you would just use the same kind of calls to get input from the POV as you would for anything else.

    Code (csharp):
    1. player.GetButton("SomeAction"); // or use event-based input if you like
    If you've assigned SomeAction to one of the POV directions, you will get input from it. Rewired's Player-Action design makes it so you rarely have to care what device or elements on that device are being used. If you haven't done so, I would strongly suggest you start by reading the Documentation.
     
  20. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    i




    Actually not Battlezone 9 variant becuasethat was an error you should try playing Battlezone 98 and Battlezone 98 Redoux plus Battlezone 2 FPS R.T.S Versions they are well cool I didn't know the that CH Products had the Rudder Paddles on the Joystick Throttle. I always thought they had separate pedals for rudder control..

    Oh yes I was testing Rewired out using the Spaceflight Controls asset you can get from the Unity Asset Store I think
     
  21. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    OK I will look up more on the documentation and as I said I was using the Spaceflight Controls Asset you can get from Unity's asset store to test it out Thanks a lot for for the extra code by the way
     
  22. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,608
    Okay, thanks for the explanation.

    Most Unity Asset Store assets which are built around UnityEngine.Input can be easily made to work with Rewired without changing any code by using Unity Input Override. Otherwise, if you want to change the scripts, it's usually as easy as just one search and replace.
     
  23. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Okay. Never tried those variants but I will see if I can take a look at one.

    Actually it is a flight yoke not a joystick that has the rudder paddles. See the following URL for more details.

    http://www.chproducts.com/Eclipse-Yoke-v13-d-717.html

    Here is a screen shot so you can see the little paddles in the middle.

    Eclipse-Yoke-v13-p-178.jpg

    These are pro pedals that we are talking about.

    http://www.chproducts.com/Pro-Pedals-v13-d-716.html
     
  24. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    @Vampyr_Engel

    Another issue to need to consider is some users are mixing and matching different vendors products. Someone users might have ThrustMaster T-16000M stick and CH's Pro-Throttle which is a common combination. On the Elite Dangerous forums you see that players are mixing and matching a lot of different hardware. Sometimes one part of their HOTAS product is broken (like a stick or throttle) and the product is discontinued so they have to get another vendor's product to supplement it.

    Also users might want to experiment with different controller combinations which you have not expected because the end users have those available. Some may want to test playing a FPS game with a racing wheel. :eek: Yes it can be done and I have done it easily with Rewired and Realistic FPS. I have also tested Flight Sticks (HOTAS) with normal racing wheel pedals because I did not have flight pedals available at the moment in time. Using a racing wheel to control a horse is another one I have done. There are endless controller combinations that are really easy to do with Rewired that you should allow users to perform.

    To handle all of these mixing of various hardware you should include Rewired's Control Mapper (or similar mechanism) so players can remap the controls within the game. Also when hardware is simply not available to us as developers. For example I do NOT plan on spending $6,000 for a pair of high quality (professional) flight pedals. (e.g. https://flypfc.com/shop/rudder-pedals/dual-professional-rudder-pedals-general-aviation/ ) for testing purposes. But some user might have that available on their system.

    That is where power of Rewired's Control Mapper really comes into play to solve the end user's need to remap controls to handle all of these use cases. More info on Control Mapper can be found here.

    http://guavaman.com/projects/rewired/docs/ControlMapper.html
     
  25. Maverick

    Maverick

    Joined:
    Dec 18, 2009
    Posts:
    240
    So, I've added RewiredStandaloneInputModule as described in your documentation, disabled unity's input module. And it works fine, until I'm adding PhysicsRaycaster to my camera. Everything stops working. I need raycaster to be able to handle "mouse over" event on 3d objects in the scene.

    How do I make it to work together?

    Thanks.
     
  26. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    I did not see anything in your previous forum posts about what setup you have.

    What version of Unity are you using?
    What operating system?
    What version of Rewired are you using?
    What platform are you targeting for your build?
     
  27. Maverick

    Maverick

    Joined:
    Dec 18, 2009
    Posts:
    240
    From release notes version is 1.0.0.104.
    We aim for Standalown platforms for now: Mac, Win, Linux.
    Unity 5.5.0f3
     
  28. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,608
    Can you be more specific? Exactly what is not working anymore once you add the PhysicsRaycaster to the camera? Does it work with the StandaloneInputModule instead of the RewiredStandaloneInputModule?
     
  29. Maverick

    Maverick

    Joined:
    Dec 18, 2009
    Posts:
    240
    When PhysicsRaycaster is added to camera clicks event (for example) are not triggered anymore. If I disable PhysicsRaycaster the everything starts working as usual. There is no difference if we use StandaloneInputModule instead of the RewiredStandaloneInputModule.
     
  30. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,608
    Click events on the UI or on the 3D objects are no longer triggered?

    Then the problem is not Rewired if the StandaloneInputModule behaves the same way. It's got to be something else in your setup unrelated to Rewired.

    I have done my own test using the Control Mapper demo (because it uses Unity UI), a 3D cube, a PhysicsRaycaster on the camera, and a script added to the cube that logs the pointer events. Everything works correctly and Control Mapper still functions as always with the keyboard and the mouse.

    Code (csharp):
    1. using System;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using UnityEngine.EventSystems;
    6.  
    7. public class PhysicsRaycasterTest : MonoBehaviour, IPointerDownHandler, IPointerEnterHandler, IPointerExitHandler, IPointerUpHandler {
    8.     public void OnPointerDown(PointerEventData eventData) {
    9.         Debug.Log("Down");
    10.     }
    11.  
    12.     public void OnPointerEnter(PointerEventData eventData) {
    13.         Debug.Log("Enter");
    14.     }
    15.  
    16.     public void OnPointerExit(PointerEventData eventData) {
    17.         Debug.Log("Exit");
    18.     }
    19.  
    20.     public void OnPointerUp(PointerEventData eventData) {
    21.         Debug.Log("Up");
    22.     }
    23. }
     
  31. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,608
    If your UI canvas is set to Screen Space - Camera, a 3D object could block the raycasting to the UI. Do you have some plane or other 3D object in front of your camera that could get between the UI and the camera? That's the only situation I can imagine that would make UI clicks stop working by just enabling the PhysicsRaycaster component. There are Blocking Objects and Blocking Mask properties on the Graphic Raycaster and an Event Mask property on the Physics Raycaster which might be useful. If the Canvas GraphicRaycaster's Blocking Objects property is set to All or ThreeD, 3D objects can block UI clicks. I suggest asking on the Unity forum in general if this doesn't solve it.
     
    Last edited: Mar 9, 2017
  32. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    Oh I see, So you have different combinations like what the Thrustmaster Attack Throttle does where as long as it connects in the old Joystick port connectors you can use different controllers like wheels joypads , other joysticks and Flight Yokes and you could use Racing car or car pedals for flight pedals (Rockfire and Genius used to sell racimng wheels with pedals that can be used for flight) Never did that though used a racing wheel to ride a computer horse may hae to try that and well I have used FPS games with a H.O.T.A.S setup Still I think most players with a Thrus tmaster Afterburner Afterburner2 or TFlight HOTAS X and Saitek X45 or Saitek X36 USB
    And if you can see those hand paddles on the throttle of the Afterburner 2 well this is what I and I think other players will be using for straffing left and right 668_a76_300_300-driver-thrustmaster-top-gun-fox-2-pro-shock.jpg
    TFlightHotasX-Thrustmaster-PCAviator-PS3-3.jpg

    This is the TFlight HOTAS X version As you can see the Rudder Paddles on the Joystick throttle there TFlightHotasX-Thrustmaster-PCAviator-PS3-4.jpg And the T/Flight H.O.T.A.S 4 here on the throttle here
    Thrustmaster TWCS Throttle.jpeg
    And you can see it here on the Thrustmastart TWCS



    P3230006.jpg
    This is also on the Saitek X45 and Saitek was the first to do this on a throttle as far as I know and thats how I will have it with the joystick turning left and right and the hat being able to move the camera left and right and up and down I hope Rewired can do all that and yes I am looking to buy as I have said
     
    Last edited: Mar 13, 2017
  33. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    Oh yes and this is where the Hand Rudder Paddles Started Saitek X36 USB GAMEPORT.jpg With The Saitek X36T Throttle
     
  34. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Always nice to see more HOTAS pictures. :) Mixing and Match controllers is really useful and also it makes testing easier if you have 10+ controllers attached and you want to get a good idea of how it will work across each controller.

    Never worked with any pre-USB style PC game port controllers so I do not know how they even work in modern PCs (Windows 7/8/10, etc.). I did not think there was any windows drivers from the manufacturer to support devices that old. Or is there some sort of game port to USB adapters that need to be used for this work correctly?

    I have only worked with USB game controllers so no knowledge of the older game port style.

    Throttles are bit more involved since most are large amount of functionality differences. A good example is Saitek X-45 vs the Saitek X-55). I am looking at the Saitek X-45 manual found here since I am not familiar with the physical device.

    http://www.saitek.com/manuals/X45_Manual_update.pdf

    I am not familiar with the Saitek X-45 since I do not have one but @Steve-Tack does. In the X-45 it looks like the rudder is mapped to Stick Rotate in the Rewired HOTAS template.

    In Rewired the T.Flight HOTAS.X (this is called Throttle rocker) and Thrustmastart TWCS (rocker) are both mapped to Throttle Slider 1 in the Rewired HOTAS template.

    There are several HATS on some Throttles so mapping those should not be an issue if you wish to do that also. That is in addition to the Joystick POV HAT.

    It makes Rewired Control Mapper such a nice option when you have to consider keeping all the end users happy who like to remap everything. It also makes testing and experimenting that much easier.
     
  35. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    The Thrustmaster Throttle TWCS also has the option of plugging in the ThrustMaster T-Pedals (rudder pedals) so they will appear as a single controller. I believe the T/Flight H.O.T.A.S 4 has the same capability to plug in the T-Pedals too.

    So now you have ThrustMaster Throttle TCWS that has both a rocker and rudder pedals on the same device. So a end user might want to map those differently then just the Throttle TWCS by itself. Another reason why Rewired Control Mapper is good solution for end user remapping.

    Rewired does handle both use cases for the ThrustMaster Throttle TWCS of standalone and with flight pedals plugged in.

    Let add a third use case with Thrustmaster T.16000M FCS FLIGHT PACK and this makes a nasty combination of rudder options. This seems to be a popular package these days for the price point.

    http://www.thrustmaster.com/en_US/products/t16000m-fcs-flight-pack

    ThrustMaster_FCS_flight_pack.png
    So now we have three "rudder pedals". The T16000M has a twist stick (rudder), then we have the Throttle rocker axis (rudder) and then the T-Pedals (rudder). Think of all of the possible combinations the end user might want to remap these three controllers. That is why you really need to use Rewired Control Mapper or something similar so the end user can map those controls differently. Also it can be used as two physical controllers because the T-Pedals can be plugged into the ThrustMaster Throttle TWCS.

    Thankfully Rewired knows about all three devices either independently as 3 devices or as 2 devices.

    One of the reason why I like CH Products is everything is nicely separated by function (Stick, Throttle, and Pedals). The twist stick just seems to make things more complicated especially when you have rudder pedals in the picture.
     
  36. HittmanA

    HittmanA

    Joined:
    Jul 27, 2016
    Posts:
    45
    Hey I just got Rewired and I was wondering how to get input from a PS4 controller. How can I get input from the buttons (Square, X, Triangle, O), the 4 triggers (L1, L2, R1, R2), and 2 joysticks?
     
  37. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,608
    You get input from a PS4 controller exactly how you get input from any other controller. Generally you don't. You get input from the Player.

    Please read the Rewired documentation. It is very thorough and will teach you how to use the system. It is organized in order so that you will be able to understand the concepts of the system.
     
  38. Vampyr_Engel

    Vampyr_Engel

    Joined:
    Dec 17, 2014
    Posts:
    449
    Somehow I doubt they work I think I tried my old Saitek X36 Gameport HOTAS in Windows XP and if I remember correctly I had to use a Gameport to USB converter to make it work right in XP and I lost a lot of Button usability as gameport joysticks are too old for USA I doubt they would work now They would work on Windows 95 SP3 Windows 98 08 SE and M E and possibly Windows 2000 Operating systems. Also why can't you map the Saitek Throttle Rocker/ Rudder Paddles the same way you can map the Thrustmaster Rocker (Throttle Slider 1 ) and is that control OK for Rudder Pedal control as well as using that control for Hovercraft /Hovertank /Human player strafing? And is stick Rotate the same thing? I guess I shall have to read the documentation so that I would know which axies to use for rudder control

    and yes I am aware that the Thrustmaster has the twist rudder I hate twist rudder which is why I refuse to buy the latest Saitek sticks because you only get the choice of twist rudder on the stick or pedals while Thrustmaster now provides for all three and yes that was an actual dilberate confirmed commercial decision hence Saitek bye bye and thier quality has gone down anyway They need Logitech to take them over and sort their quality out.

    Oh yes never ever got any CH products both when it was Gameport or USB I would like to get thier products though as they come highly recommended
     
    Last edited: Mar 13, 2017
  39. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    There is no reason they cannot be mapped to the same action. That is how I have my mapping set up so they are both mapped to the same action as default.

    Logitech has taken over Saitek but they have just rebranded the existing product and not changed anything yet. So the quality is still poor. And at least for the Saitek X-56 they have cut the warranty from 2 years to 90 days which is crazy considering the price point of $230 or so. At least that is how it is in the USA.

    Just looking at the Amazon reviews for Saitek you can see how low the quality has gotten. If Logitech makes a brand new product it will be good.

    The CH Products seem to last much longer then their competitors and they have not changed their design either since the 1980s and it is still selling. Have not had to use their tech support yet but you can call and get some spare parts too. This is helpful when the warranty expired and you can fix something themselves.

    This is the main site.

    http://www.chproducts.com/13-28464-Home.php

    This for technical support in their forums. They also have phone technical support.

    http://www.ch-hangar.com/

    It is funny to hear stories about someone using their CH Products for 17 years and it is still going strong. It great when you keep hearing that same type story regularly.

    What we really need in our games is a voice like they have in Fighter Jets ... it makes a wonderful addition. This short video is on the woman who did the F-18 warning system and was retiring from Boeing. The US system is called "Bitchin Betty" and has been in most US Fighter aircraft since the 1970s I believe. Different women have done the voices but the generally sound all the same which is by design.

     
  40. HittmanA

    HittmanA

    Joined:
    Jul 27, 2016
    Posts:
    45
    Your right, we do! I may see if I can add something similar to my game.
     
  41. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,608
    You can map any Action you want to any element you want. @longroadhwy is describing how to use the HOTAS template, which is a system that just makes it easier to map once and have it work across all compatible recognized devices. Templates are described here. You don't have to use the Template -- you can just map for the device directly and have access to all the elements on the device by name. Or you can map for the Template and then override the mappings for certain devices by creating individual device mappings if you know you want them to behave differently. And ultimately, all of this mapping is just developer defined defaults which will load automatically when a device is assigned to a Player. Your users are free to remap their controls as they see fit in-game as long as you provide them a way to do so such as using Control Mapper.
     
    Last edited: Mar 13, 2017
  42. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,608
    This made me think of the possibility of using a voice recognition system to issue commands to your game. You could use a Custom Controller to trigger Actions in-game using voice commands.
     
  43. FlaxenFlash

    FlaxenFlash

    Joined:
    Oct 15, 2015
    Posts:
    28
    Hey, I decided to try and get my Logitech G29 working with my game today and everything seemed to be working fine except my clutch pedal which wasn't registering at all. I did some poking about and got it working by changing the clutch's source axis in the G29's profile to the y axis instead of Slider0. Is the included profile just wrong or could I have configured the wheel in some strange way that is causing this problem?
     
  44. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,608
    I'm going to assume you're talking about Windows and that you're using Raw Input.

    The G29 definition was made by another user of Rewired. I do not have a wheel to test with. It did work when he made it. However I will tell you that the version of the Logitech driver you're using or if you don't have a driver installed will change the mappings. The Logitech driver also has settings for changing how the axes behave (separate or shared axes). The definition has special code to try to account for both axis options, but if Logitech has changed something in their driver or allowed you to manually set which axis is which, it will not be able to detect or handle that.

    I have never seen a Logitech wheel use Y for the clutch axis however. The G25 and G27 use Slider 0 for Clutch in Raw Input and Slider 1 for Direct Input. If no driver is installed, the Clutch doesn't work on those devices.

    In addition, according to Logitech the device needs to be in PS4 mode when used on a PC.
     
    Last edited: Mar 14, 2017
  45. FlaxenFlash

    FlaxenFlash

    Joined:
    Oct 15, 2015
    Posts:
    28
    Yep, Windows and Raw Input.
    I have the most recent version of the Logitech software installed, and I'm using separate axes and I have the wheel in PS4 mode. I don't believe there is any way to manually change the axes from the software and I certainly haven't done so on purpose. None of this really matters to me though, I just thought I'd let you know in case it was something you wanted to look into. My game is not particularly suited for racing wheels anyway, I just wanted to try out a silly idea I had for a control scheme to see what it would be like. It's not something I intend to ship the game with at this point.
    Besides that rewired has been great so far, thanks so much for making it!
     
  46. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Are you running Windows 10 or some other version? And is this 32-bit or 64-bit? Is this Home/Pro/Enterprise version of Windows?
    What version of Unity?
    What version of Rewired?

    With your G29 do you have an add-on Shifter installed?

    Have you used the Logitech software and remapped anything? http://support.logitech.com/en_us/a...ch-Gaming-Software?product=a0qi0000006PmxKAAS
     
  47. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    What type of game are you making?
     
  48. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    That would be fun. I have spend more time looking at the custom controller part of Rewired.
     
  49. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,608
    Well, if you don't mind, could you try doing a test?

    With the G29 attached (and preferably nothing else):

    Create a new scene.
    • Add a Rewired Input Manager (empty is fine).
    • Drag in the Assets/Rewired/DevTools/JoystickElementIdentifier.prefab into the scene.
    • Press Play.
    • Press the 3 pedals and note which axes change, what direction the change is in, the value at rest, and the value at full press.
    Send me this information so I can see how it compares to the current definition.

    Also, @longroadhwy's question about Windows version may be relevant here.
     
  50. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    What was the price of this when it was on sale in early March?