I am currently writing a script to move a character around a map:
import GameLogic
cont = GameLogic.getCurrentController()
owner = cont.owner
mmove = cont.getActuator('Mousemove')
keys = cont.getSensor('Keys')
keylist = keys.getCurrentlyPressedKeys()
if keys.isPositive():
for i in keylist:
if i == [97,1]:
m = mmove.getLinearVelocity()
mmove.setLinearVelocity(-owner['mspeed'],m[1],m[2],1)
if i == [100,1]:
m = mmove.getLinearVelocity()
mmove.setLinearVelocity(owner['mspeed'],m[1],m[2],1)
if i == [119,1]:
m = mmove.getLinearVelocity()
mmove.setLinearVelocity(m[0],owner['mspeed'],m[2],1)
if i == [115,1]:
m = mmove.getLinearVelocity()
mmove.setLinearVelocity(m[0],-owner['mspeed'],m[2],1)
GameLogic.addActiveActuator('Mousemove',True)
And I have run into a bit of a problem. I want my character to completely stop moving once the key(s) are released, as opposed to what is happening now, with the character sliding along as though he is on ice. Thanks for the help!