Problems with controller third person setup

Hey.
So im having a few problems with my setup.

  • It has limited directions to go in. If you have ever played games like SUPER MARIO 64 youll know that the character moves just like your stick. It really feels like you are pointing him in a direction. My setup however ( shown in the picture below ) consists of 4 arrows that the character tracks to when the player steers him in that general direction. This works well on keyboard but when using a controller it feels very wierd. Also that means that you can only go on a grid ( only straight foward/backwards/left/right ) wich isnt really that great. The whole thing is vertex parented to my character
    My setup with the arrows.The character
  1. My current code gets stuck. Alot. Heres the code:

import bge


cont = bge.logic.getCurrentController()
obj = cont.owner
scene = bge.logic.getCurrentScene()
sens = cont.sensors["Xbox360"]
tforward = cont.actuators["track forward"]
tright = cont.actuators["track right"]
tleft = cont.actuators["track left"]
tback = cont.actuators["track back"]


upDown=sens.axisValues[1]/1000
leftRight=sens.axisValues[0]/1000
print("LeftRight:",leftRight,"UpDown",upDown)
last='none'


if upDown>5:
    last='track back'
    cont.activate('track back')
    print("BACK")
    
    cont.deactivate(last)
if upDown< -5:
    last='track forward'
    cont.activate(tforward)
    print("FORWARD")
    
    cont.deactivate(last)
if leftRight>5:
    last='track right'
    cont.activate(tright)
    print("RIGHT")
    
    cont.deactivate(last)
if leftRight< -5:
     last='track left'
     cont.activate(tleft)
     cont.deactivate(last)
     print("LEFT")

 It seems that when i move my character in all directions it just stopps wich is really wierd. Even wierder is that my console is still outputting correctly ( LEFT , RIGHT... ) but the character isnt tracking.:spin:

a

If you need anything else ( like the blend or anything ) then please. Ask.
Thanks in advance!

Attachments