- Home /
Detect if an XBOX 360 controller is plugged in
I'm looking for a way to detect if an XBOX 360 controller is currently plugged in. I know of Input.GetJoystickNames(), but that, in my experience, only detects if it has been plugged in before. Help?
I have a 360 controller hooked up with TattieBogle drivers and it seems to works when I check it in my system preferences, but when I start unity there is nothing in the console prompting me that it is hooked up. I tried some simple movement scripts and nothing. Appreciate any help!
Answer by screenname_taken · Sep 16, 2014 at 07:39 AM
You can check the length of the Input.GetJoystickNames array every so often. If it's bigger than 0 then you have atleast one joystick controller.
Your answer
Follow this Question
Related Questions
Help Needed: How to Use Input Manager on UI Button 0 Answers
How do I standardize my game's input to different types of controllers? 1 Answer
How do you properly deal with analog joystick input on multiple controller inputs? 1 Answer
C# How to program X-Axis on Controller. 0 Answers
Using Input.GetJoystickNames 1 Answer