Hello, I’ve browsed the forums and I can’t seem to find a fix for this. I’m new to python and built on a previously made script. I’m trying to use two sensors at the same time, but I don’t know how to implement it.
Example:
cont = bge.logic.getCurrentController()
move = cont.actuators[“move”]
#–Sensors–
press_w = cont.sensors[“W-Key”]
press_a = cont.sensors[“A-Key”]
press_s = cont.sensors[“S-Key”]
press_d = cont.sensors[“D-Key”]
#Diagonal WASD movement
press_wa = press_w + press_a #<– Tried adding variables
press_wd = cont.sensors[“W-Key”, “D-Key”] #<–Thought this was a list
EDIT: I’ve tried just using this in the movement:
elif press_w.positive and press_a.positive:
and still no luck. There are no errors, but the character wont move in the direction I want even with both sensors positive.
Whole Script: pastebin: /cMDTZ9R1
[Fixed Script]: pastebin: /3z3iLSX7