I am making a python script which controlls the actions of a armature with Gamekeys. The problem is that so far I know you can’t press 2 keys at a time if you use that.
When you hold For example W key, and when still holding W key press another key, the action of the W key stops.
…
Sorry I’m terrible at explaining my problem in English. xD
Anyway, Someone understands me and know a solution?
Thanks a lot :yes:
edit
cont = GameLogic.getCurrentController()
own = cont.getOwner()
import GameKeys
running = 0
keys = cont.getSensor(“run”)
run = cont.getActuator(“Run”)
I think that is a problem of your script. Because you can press multiple keys at the same time.
When the action stops you deactivated the actuator. If you add some print statements you can see what the script does and when it activates/deactivates the actuator.
if keys.getKeyStatus(wKey) == GameLogic.KX_INPUT_JUST_ACTIVATED:
print "wKey pressed"
if keys.getKeyStatus(aKey) == GameLogic.KX_INPUT_JUST_ACTIVATED:
print "aKeypressed"
but you cannot trigger both running = 1 and running = 0 in the same frame, so if you just replace the elif with an if in your code it still will give back running = 0 when both keys are pressed.