Search Unity

[RELEASED] [FREE] Gamepad Input. Quick gamepad set up!

Discussion in 'Assets and Asset Store' started by Merrik44, Aug 5, 2013.

  1. Merrik44

    Merrik44

    Joined:
    May 8, 2013
    Posts:
    38
    $GamePadInput+header.png


    Hey! I wrote a script that makes setting up gamepads quick an simple. I found it pretty handy, so I thought I'd share it with the community by putting it on the Asset Store for free.

    The script allows you to access trigger, analog stick and button presses in a similar fashion to the Input class.


    Example:

    Code (csharp):
    1. GamePad.GetTrigger(GamePad.Trigger.RightTrigger, Gamepad.Index.One);
    2. GamePad.GetAxis (GamePad.Axis.LeftStick, Gamepad.Index. Any);
    3. GamePad.GetTrigger(GamePad.Trigger.RightTrigger, Gamepad.Index.Four);
    You can also retrieve the entire state similar to XNA:

    Code (csharp):
    1. GamepadPadState state = GamePad.GetState(Gamepad.Index. Four);

    Currently it's configured for xbox controllers, however, if their is a demand I can add support for other gamepad's, such as Logitechs and PS3 as they may have different bindings.

    You can find the package and a demo here.

    Hope it's useful!
     
  2. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,054
    Maybe for ouya as well. Nice from you to share this.
     
  3. Merrik44

    Merrik44

    Joined:
    May 8, 2013
    Posts:
    38
    @rosor: Great idea, I'll look into Ouya support!
     
  4. UnleadedGames

    UnleadedGames

    Joined:
    Feb 17, 2008
    Posts:
    242
    +1 on Ouya support I would even pay for something like that to make my life easier.