Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Detecting Brand of Controller

Discussion in 'Scripting' started by DoogleNoob, Jan 28, 2016.

  1. DoogleNoob

    DoogleNoob

    Joined:
    Jan 28, 2016
    Posts:
    3
    So I am trying to make a game where the input is xbox/ps guitar hero controllers. I have already mapped the controls, but I was curious as to whether you can code inside a custom input manager the brand of controller that has been inputed? I was looking at Input.DetectJoystickNames but that seems to only return how many different joysticks are plugged in as opposed to the brand of controller. So you plug in ps controller (Joystick connected ("Guitar Hero3 for PlayStation (R) 3").) Any Ideas, solutions?
     
  2. SwaggyMcChicken

    SwaggyMcChicken

    Joined:
    Apr 13, 2015
    Posts:
    108
    I think that guitar hero controllers are just normal controllers meant to look and feel like guitars, so I'm not sure if you can get a specific Guitar Hero3 for PlayStation type of reply.
     
  3. DoogleNoob

    DoogleNoob

    Joined:
    Jan 28, 2016
    Posts:
    3
    Then just detection from the different brands of controllers, as telling if I connected an Xbox controller or a PlayStation controller. Do you know a way of accessing/reading that in Unity?
     
  4. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,032
    You'll need a native plugin that gets USB information, probably.
     
    DoogleNoob likes this.
  5. DoogleNoob

    DoogleNoob

    Joined:
    Jan 28, 2016
    Posts:
    3
    Ok, so I figured it out, I was being stupid. The Input.GetJoystickNames() was the answer, I thought it you assigning the names to the controllers and not Unity telling you what the controller name was. All good now.