Ps4 Controller Script

Description

This Blend File is a example on how to setup a Playstation 4 Controller with only one Python Script.

The Script controls all Buttons, the Hat and the Analog Stick input, also the sensibility of the Analog Stick will be recognized.

__Controls: __

Left Analog-Stick or Hat = Moves the Ball

Right Analog-Stick = Camera Control

X-Button = Jump (Hold the X-Button for slower falling)

R1-Button = Turbo

If no Ps4-Controller is connected, the Mouse and the Keyboard provides the input (Keys_and_Mouse.py).

[PS4 Controller Python Script - Blender Game Engine](https://www.youtube.com/watch?v=_Kh2ar6xRak)

https://www.youtube.com/watch?v=_Kh2ar6xRak

Comments (21)

3
3DHaupt about 11 years ago

Unfortunately, I do not have an Xbox 360 controller and now I wonder how different the input could be. I want an Xbox 360 controller :D, maybe I find one in a second hand store :)

C
crazymoe2012 about 11 years ago

dude study the code and convert it

D
DEEPgames about 11 years ago

Not everybody know how to code.

D
DEEPgames about 11 years ago

By the way siege, you may be able to test it. I set up game pad support on an fps and I believe it worked for both ps3 and xbox 360, so it may also work with this coding... Just a thought.

S
solarforge about 11 years ago

I will purchase a PS4 controller ASAP, and try this script out ; Thanks a lot for sharing this... I just tried it out with a Microsoft controller and a few buttons seem to be responding, not the right ones, but it sort of works :)

3
3DHaupt about 11 years ago

Cool, sounds like it would be easy to convert it for a Microsoft controller, its only a sorting thing I guess.

T
The_TiPi about 11 years ago

Reminds me Marbble Madness :D Great work ;)

N
nad451 almost 11 years ago

Works with a xbox 360 controller. One axis that controls the camera is wrong and the keys are not the same. Should be easy to edit in the script.

W
wout over 10 years ago

wow !

K
kotekote327 about 10 years ago

one question, can i use this script for my game?

3
3DHaupt over 9 years ago

Yes of course you can use it!

L
logicjazzpianist almost 10 years ago

In version 2.77 doesn't open with STANDALONE!!!

R
Rainbowdash99 over 9 years ago

daaaamn i love you man

C
cederom over 9 years ago

very nice! thanks! works like a charm on my macbookpro and ds4 over bluetooth! :-)

3
3DHaupt over 9 years ago

Nice to hear that it still works :)

P
peterdegroote over 8 years ago

I will try to use it in a self made game in blender. thanx in advance.

3
3DHaupt over 8 years ago

Cool :)

J
Josetjtj over 8 years ago

Blender creates video games for PC and there is an addon that can create video games for all types of consoles

M
MisterOid over 8 years ago

Hey, is it possible to make this compatible with the UPBGE?

T
turb0 about 8 years ago

it works it works it works :D

I
itechnii_1117581 about 6 years ago

Good Day! Thank you for this amazing little script! Is there a way for it to work with Blender 3D when animating the 3D camera in a scene to simulate that handheld camera move as opposed to manually moving the camera with a mouse? Thank you for sharing!

Sign in to leave a comment.