XBox 360: Right Stick Sticks

I just got a new computer. I have a couple games where the right stick on my XBox 360 controller controls the camera through Python. Even though I have the software installed, the camera drifts around when I let go of the stick. Changing the threshold on the Joystick actuator doesn’t work, either. I don’t know what to do. Should I get an XBox One controller, or what? Here’s one of the games. Thanks.

PyPlatTeach.blend (527 KB)

Upbge has much better 360 support, also make sure your joystick is properly calibrated.

it’s rather simple, build in a deadzone (zone where sticks dont react)

example:


import bge.logic as logic


cont = logic.getCurrentController()
player = cont.owner


joy = cont.sensors['Joystick']
aXis = joy.axisValues


# Store the axis positions / 100,000 in variables
axisx = aXis[0] * 0.00001
axisy = aXis[1] * -0.00001


# if the joystick position in within 1500 of the center, then zero it out (1800 or 2000 works better on some joysticks)
if axisx < 0.01500 and axisx > -0.01500:
    axisx = 0   
if axisy < 0.01500 and axisy > -0.01500:
    axisy = 0

Should I get an XBox One controller

if yours works in blender, not needed. if you want a controller that has been supported by all games, then yes. (btw xbox 1 or xbox 360 controllers are the same thing, i use my 360 since it came out, converted the rf module and made it working with windows. never had a single problem)

That did it. Thanks. Python to the rescue, yet again.