Skip to content

Commit 99e3d78

Browse files
authored
Merge pull request #53 from SeiferTim/main
added colin's blog post
2 parents 299afe5 + 7c73200 commit 99e3d78

File tree

5 files changed

+105
-2
lines changed

5 files changed

+105
-2
lines changed
2.97 MB
Loading

assets/scss/abstract/styles.scss

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,4 +259,14 @@ header {
259259
max-height: 64px;
260260
display: inline !important;
261261
}
262-
}
262+
}
263+
264+
pre {
265+
background-color: black;
266+
padding: 1rem;
267+
code {
268+
word-break:normal;
269+
}
270+
}
271+
272+
2.97 MB
Loading
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
title: "Unity Support for Generic Gamepads"
3+
date: 2025-07-14
4+
draft: false
5+
tags: ["unity","coding", "tutorial", "game development","tips"]
6+
authors: ['Tim I Hely', 'Colin (miniscule)']
7+
images: ["images/blog/pexels-tima-miroshnichenko.jpg"]
8+
---
9+
10+
Out-of-the-box, Unity (among other engines) seems to only want to use Xinput-devices for inputs (like gamepads) in the Input Manage, which means that it doesn't know how to talk to older, generic input devices by default. We learned this the hard way while trying to set up our Demo Arcade Machine.
11+
12+
After some experimentation, Colin (miniscule) figured out a solution which, even if you are not submitting a game for us to use in out demos, we still want to show you how to fix so that anyone, with any kind of controller, can play your game.
13+
14+
<!-- more -->
15+
16+
In order to support the controller you will need to type in the button paths manually on each binding. The bindings all start with:
17+
18+
```unity
19+
<HID:: USB Gamepad >/
20+
```
21+
22+
⚠ Yes that’s *10 spaces* between Gamepad and ‘>’, yes from what I can tell you do need *exactly* 10 for it to work.
23+
24+
Afterwards you specify the button at the end, for example:
25+
26+
```unity
27+
<HID:: USB Gamepad >/button3
28+
```
29+
30+
If done correctly it should show up in your bindings list formatted like:
31+
32+
```unity
33+
Button 3 [ USB Gamepad ]
34+
```
35+
36+
If it shows up more like this:
37+
38+
```unity
39+
button3 [HID:: USB Gamepad ]
40+
```
41+
42+
..then you’ve made a mistake, likely in the number of spaces.
43+
44+
The following are the button names and their corresponding buttons on the controller (using PS2 names)
45+
46+
<dl class="row ">
47+
<dt class="col-md-2 ">Triangle</dt>
48+
<dd class="col-md-10 ">Trigger</dd>
49+
<dt class="col-md-2 ">Circle</dt>
50+
<dd class="col-md-10 ">button2</dd>
51+
<dt class="col-md-2 ">X</dt>
52+
<dd class="col-md-10 ">button3</dd>
53+
<dt class="col-md-2 ">Square</dt>
54+
<dd class="col-md-10 ">button4</dd>
55+
<dt class="col-md-2 ">L1</dt>
56+
<dd class="col-md-10 ">button5</dd>
57+
<dt class="col-md-2 ">R1</dt>
58+
<dd class="col-md-10 ">button6</dd>
59+
<dt class="col-md-2 ">L2</dt>
60+
<dd class="col-md-10 ">button7</dd>
61+
<dt class="col-md-2 ">R2</dt>
62+
<dd class="col-md-10 ">button8</dd>
63+
<dt class="col-md-2 ">Select</dt>
64+
<dd class="col-md-10 ">button9</dd>
65+
<dt class="col-md-2 ">Start</dt>
66+
<dd class="col-md-10 ">button10</dd>
67+
<dt class="col-md-2 ">D-Pad</dt>
68+
<dd class="col-md-10 ">hat</dd>
69+
<dt class="col-md-2 ">Left Stick</dt>
70+
<dd class="col-md-10 ">Stick</dd>
71+
</dl>
72+
73+
If you need to set a specific direction on the dpad or left sick you can put the direction afterwards, separated by a slash, for example:
74+
75+
```unity
76+
<HID:: USB Gamepad >/hat/up
77+
<HID:: USB Gamepad >/stick/down
78+
```
79+
80+
For the right stick it will not be recognized as its own thing, you'll need to add it as a 2D Vector (choose add Up\Down\Left\Right Composite from the binding dropdown)
81+
For Up and Down, bind them to the Z axis:
82+
83+
```unity
84+
<HID:: USB Gamepad >/z
85+
```
86+
87+
For Left and Right, bind them to the RZ axis:
88+
89+
```unity
90+
<HID:: USB Gamepad >/rz
91+
```
92+
93+
On Up and Left, you will need to go to the processors dropdown (below bindings) and add an invert so that they will output negative values.

content/news/share-and-play-q2-2025/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A huge thank you to everyone who came out to see these incredible games! If you
1616

1717
***
1818

19-
### ✨ Here are the eight games that were featured:
19+
## ✨ Here are the eight games that were featured:
2020

2121
<center><img src="images/stlouis-share-and-play-q2-2025-06.png" width="66%" alt="Untitled game by Luke Puchner-Hardman"></center>
2222

0 commit comments

Comments
 (0)