How to look wit xbox controller

I can look with a mouse script, how would i do it with a xbox controller.
Thanks for helping.

@maseratzi You are probly spinning because of how sensative the joysticks are. they rest at around ± 100 and are hard to get to stay at 0.

if you are using the python script that HG1 posted in the other thing then you just need to change it to this…

import GameLogic as g

cont = g.getCurrentController()

# get first sensor
axis = cont.sensors[0]

# get first actuator
act1 = cont.actuators[0]

# get secound actuator
act2 = cont.actuators[1]

# get axis value
val = axis.axisSingle

# Clamp min and max distance
if axis.positive:
    if val > 100:
        cont.activate(act1)
        cont.deactivate(act2)
    elif val < -100:
        cont.activate(act2)
        cont.deactivate(act1)
else:
    cont.deactivate(act2)
    cont.deactivate(act1)

you could use a number other then 100, play around until it is at the right sensativity.

I’ll attach an old 2.49 file that I used logic bricks and different sensativities to have it seem smoother…
I used the axis 3 = L/R and axis 2 = U/D, to get around the problem of the right stick not being recognized correctly.

Attachments

House_in_A_hill_noTexture.blend (436 KB)