Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2004
    Location
    near Orlando, Fl
    Posts
    5,302

    Xbox360 controller in unity?

    I'm not having any luck finding this in any unity documentation... I know that there is a unity 360 coming out sometime, but I was wondering if the Unity we are using now supports the 360 controller for a windows game?

    The game idea I have really needs the dual thumbsticks.
    The odds of hitting your target increase significantly when you aim at it.
    Check out my iOS games released in the App Store!
    Tricky Treasure Fall
    Tap 'n' Scrap
    UFO Escape From Earth

  2. #2
    Join Date
    May 2004
    Location
    UK
    Posts
    709
    Hehe, you're not making a geometry wars clone are you? that would make two of us

    I say 'making', i'm actually just thinking about

    Cheers

    Mat

  3. #3
    Join Date
    Mar 2004
    Location
    near Orlando, Fl
    Posts
    5,302
    No, I'm not doing a clone of that, so you're all set. =)

    Actually, what sucks is that I have had this idea for many years, but now the market is oversaturated with this type of game: zombies.

    But I want to make it anyway as I feel I do have an interesting twist.

    By the way, I found my answer, Unity does support gamepad input. I will have to figure out how to have it controlled by keyboard/mouse and gamepad though.
    http://unity3d.com/support/documenta...ual/Input.html
    The odds of hitting your target increase significantly when you aim at it.
    Check out my iOS games released in the App Store!
    Tricky Treasure Fall
    Tap 'n' Scrap
    UFO Escape From Earth

  4. #4
    Join Date
    May 2007
    Location
    UK
    Posts
    317
    Quote Originally Posted by DigitalDemigod View Post
    By the way, I found my answer, Unity does support gamepad input. I will have to figure out how to have it controlled by keyboard/mouse and gamepad though.
    http://unity3d.com/support/documenta...ual/Input.html
    If you look under the input settings there is a field for an alternative button called Alt Negative/Positive, you can assign your other input method there, or you could just add a new virtual button/axis

    http://unity3d.com/support/documenta...ual/Input.html
    Last edited by mol3rs; 02-17-2010 at 05:16 PM.
    applelemonhead3345 (1 year ago) Show Hide

    best movie ever saw it first when i was two
    i think if jen was a real person she would be hot

    Trialbystone17 (11 months ago) Show Hide

    Jen was a guy dude.

  5. #5
    Join Date
    Feb 2003
    Location
    UK
    Posts
    1,720

    Thumbs up Try this..

    In the simple game by Casey Jones he uses the following code to get the horizonal movement for your character.
    Code:
    amtToMove = (playerSpeed * Input.GetAxis("Horizontal")) * Time.deltaTime;
    Now this code also allows you to use your right stick on the 360 controller as the movement by default. Just remember that the controller must be active before you launch Unity.

    Later when he needs to detect the firing of a missile so he uses
    Code:
    if (Input.GetButtonDown ("Space"))
    But I changed that to read:-
    Code:
    if (Input.GetButtonDown ("Fire1"))
    and I can fire using the green A button on the 360 controller.

    So if you use those names then you can use your 360 controller. I hope that helps you a little.
    Intel i7 x5960 @ 4.6GHz (8 cores) | Asus Titan X x2 + MSI Titan X x2 | Asus ROG Rampage V Extreme | 16Gb Corsair Quad Ram | 1 BuRay Writer | 4 x 1TB HD's | Asus PB287Q 4K Gaming Monitor + Dell 24" Monitor | 1500W PSU | 150 Mbps Internet with NTL | Win 10 64 | My Home Page

  6. #6
    Join Date
    Dec 2007
    Location
    Austin, Texas
    Posts
    499
    If you want XNA style support for xbox 360 controller, check out this site:
    http://speps.fr/xinputdotnet
    Note: You MAY need to recompile it, I had to to get it working, but you MAY not actually need to, because other people said you didn't have to..

  7. #7
    Join Date
    May 2013
    Posts
    1
    I wrote a little script to wrap controller input. You can find it here.

    It mimics Unity's Input functions:

    GamePad.GetAxis(GamePad.Axis.Left, 1);
    GamePad.GetButtonDown(GamePad.Button.A, 1);


    It can also return the controller state similar to XNA, however, unlike xinput, it works with web builds.

    GamepadPadState state = GamePad.GetState(1);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •