Hi
Is it possible to just set the movement in one axis, instead of having to type 0 at the ones that I don’t really need. I have tried several things, but can’t get it working.
import bge
from bge import logic,events
cont = logic.getCurrentController()
motion = cont.actuators["Motion"]
if logic.keyboard.events[events.UPARROWKEY] == logic.KX_INPUT_ACTIVE:
motion.dLoc = [0, 0.1, 0] #Set this one to be on only one axis instead of typing all three values.
else:
motion.dLoc = [0,0,0]
cont.activate(motion)