PS4 controller map for Unity
I just spent a few minutes finally figuring this out; figured I'd save other folks the time. :)
PS4 Controller Map for Unity
Buttons
Square = joystick button 0
X = joystick button 1
Circle = joystick button 2
Triangle= joystick button 3
L1 = joystick button 4
R1 = joystick button 5
L2 = joystick button 6
R2 = joystick button 7
Share = joystick button 8
Options = joystick button 9
L3 = joystick button 10
R3 = joystick button 11
PS = joystick button 12
PadPress= joystick button 13
Axes:
LeftStickX = X-Axis
LeftStickY = Y-Axis (Inverted?)
RightStickX = 3rd Axis
RightStickY = 4th Axis (Inverted?)
L2 = 5th Axis (-1.0f to 1.0f range, unpressed is -1.0f)
R2 = 6th Axis (-1.0f to 1.0f range, unpressed is -1.0f)
DPadX = 7th Axis
DPadY = 8th Axis (Inverted?)
Edit: Formatting
Edit2: I put a question mark after Inverted because I swear that the LeftStickY axis worked just fine with one of my scripts, but when I was using a certain test case it seemed like it was inverted. YMMV.
62 comments · 99% upvoted · other discussions
I don't think this is accurate anymore. I'm trying to remap controls for a game and it's just slightly off.
drakfyre [OP] 1 points · Sep 2022 · Expert
It may depend on factors. Another user just 19 days ago said the mappings were working for them. But I haven't had time to investigate for myself.
This comment has the alternate configuration if you need it: https://www.reddit.com/r/Unity3D/comments/1syswe/ps4_controller_map_for_unity/iefpqmx/
LucanOrion 1 points · Sep 2022
Yeah, I always seem to run into things not being exactly how it is for everyone else. :)
I play a game called Elite Dangerous on ps4. I'm trying to set up my ps4 controller to play the game on PC and I want it match the ps4 configuration. Below is what the buttons were showing for me.
Buttons
Square = joystick button 1
X = joystick button 2
Circle = joystick button 3
Triangle= joystick button 4
L1 = joystick button 5
R1 = joystick button 6
L2 = joystick button 7
R2 = joystick button 8
Share = joystick button 9
Options = joystick button 10
L3 = joystick button 11
R3 = joystick button 12
PS = joystick button 13
PadPress= joystick button 14