setLinearVelocity : Object doesn't move.

I’ve tried out Social’s tutorial about making an object move. I tried to take out a small piece of it, the only problem is that it does not work.

import GameLogic as gl
cont = gl.getCurrentController()
own = cont.getOwner()

fwd = cont.getSensor("Up") #for moving the object forward

mot = cont.getActuator("movement")

if fwd.isPositive():mot.setLinearVelocity(0, 10, 0, 0)
gl.addActiveActuator("movement", 1)
#end of code

Is your object dynamic?

gl.addActiveActuator(“movement”, 1)

This should be
gl.addActiveActuator(mot, 1)

I have fixed that now Vimal.
I’ve noticed a new problem:
The script only works when the Sensor is an Always Sensor.
I wan’t it to be a Keyboard Sensor, but when I make it a Keyboard Sensor the script doesn’t work anymore.

It should work with a keyboard sensor.

define “doesn’t work”. does it return an error? if absolutely nothing happens, and you have no clues, try uploading the file so we can try and find the problem

Make sure true pulse mode is on. Then the script should run.

The script runs now. Only the physics act weird as soon I press the assigned key.