ok, I did a tutorial to help me figure out Python, which can be found HERE
anyway, I followed all of the directions to the letter, and went over it 5 times or more, and it still doesn’t work. I start the game engine, and nothing happens when I press the keys. (the game engine does start)
however, the really weird thing is, I tried copying the code HE wrote into a new text window, and tried it, and it worked! as far as I can tell, my code and his code is exactly the same.
here is my code:
cont = GameLogic.getCurrentController()
own = cont.getOwnder()
#Sensors:
forward = cont.getSensor("Up")
backward = cont.getSensor("Down")
turnleft = cont.getSensor("Left")
turnright = cont.getSensor("Right")
#Actuators
motion = cont.getActuator("motion")
#Process
speed = 5
rspeed = 0.02
walk = 0
turn = 0
if forward.isPositive():
walk = speed
if backward.isPositive():
walk = -speed
if turnleft.isPositive():
turn = rspeed
if turnright.isPositive():
turn= -rspeed
motion.setLinearVelocity(0, walk, 0, 1)
motion.setDRot(0, 0, turn, 1)
GameLogic.addActiveActuator(motion, 1)
and here is his:
cont = GameLogic.getCurrentController()
own = cont.getOwner()
#Sensors:
forward = cont.getSensor("Up")
backward = cont.getSensor("Down")
turnleft = cont.getSensor("Left")
turnright = cont.getSensor("Right")
#Actuators
motion = cont.getActuator("motion")
#Process
speed = 5
rspeed = 0.02
walk = 0
turn = 0
if forward.isPositive():
walk = speed
if backward.isPositive():
walk = -speed
if turnleft.isPositive():
turn = rspeed
if turnright.isPositive():
turn = -rspeed
motion.setLinearVelocity(0, walk, 0, 1)
motion.setDRot(0, 0, turn, 1)
GameLogic.addActiveActuator(motion, 1)
What am I doing wrong???