Search Unity

API for Joystick

Discussion in 'Scripting' started by Givago, Oct 10, 2017.

  1. Givago

    Givago

    Joined:
    Oct 22, 2015
    Posts:
    27
    There is an API / Framework (preferably free), for setting and joystick control with current controls (PC,PS4, Xbox, Nintendo Switch).
    The majority I found is discontinued or does not contemplate all platforms.

    Thanks
     
  2. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    The Unity input major sucks hard IMHO. Something like rewired (or similar, definitely not free btw) is probably what you need. I am unaware of any free alternatives so would be interested if anyone knows of one.
     
  3. Givago

    Givago

    Joined:
    Oct 22, 2015
    Posts:
    27
    but do you know of any paid that serves the purpose?
     
  4. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    Re-read my last post...
    'Rewired' is one I mentioned.
     
  5. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,145
    Only free solution I'm aware of is a very old release of InControl available on Github. I have absolutely no idea what condition it's in though and whether it'll even work with modern releases of Unity. I believe it's made for Unity 4.

    https://github.com/pbhogan/InControl

    There are two popular paid solutions on the Asset Store.

    https://www.assetstore.unity3d.com/en/#!/content/14695 - InControl
    https://www.assetstore.unity3d.com/en/#!/content/21676 - Rewired

    InControl is a far less complex beast than Rewired but it relies on Unity's Input API. Rewired completely bypasses it.
     
    Last edited: Oct 10, 2017
  6. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Rewired works on all of those platforms (PC like platforms include Windows/MAC/Linux). The largest list of supported controllers out of the box. Racing wheels, Flight controller (Hotas, flight yokes, rudder pedals, helicopter controller, joysticks), ship controller (ship console), train controllers (rail driver) and a large list of game pads.

    See the full controller list at this URL.

    http://guavaman.com/projects/rewired/docs/SupportedControllers.html

    Rewired is well supported on the Unity forums too. See this thread.

    https://forum.unity.com/threads/rewired-advanced-input-for-unity.270693/

    Rewired is my recommendation. You can get the trial version and see how it works before spending any money. It is easy to make an informed decision when you have worked with the trial.

    http://guavaman.com/projects/rewired/trial.html
     
  7. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Rewired will make your life easier, and is especially nice for game controller ("gamepad") support. You get something like 90 gamepads detected automatically out of the box that you only have to map once to a template called "Dual Analog Gamepad." And if players have a truly weird gamepad, it allows you to let them configure those manually too. That would be very rare I think though.

    You create generic actions ("move", "fire", etc) and map those to generic templates like the Gamepad one and to keyboard and mouse. So you only have to check for that action in your game code and Rewired does the rest.

    The features go WAY beyond that, but if that's all it did, it would still be worth it.
     
  8. Givago

    Givago

    Joined:
    Oct 22, 2015
    Posts:
    27
    Thanks guys,

    I'm using Rewired and its meeting my expectations.
     
  9. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825