Problem with movements script in BGE
TLDR: You need to enable True Level Triggering.
By default the &quot;Always&quot; Sensor only runs once, when game starts.
Any time you need something &quot;always&quot; triggered then you must click the little button with the three dots on the right side of the &quot;Always&quot; Sensor called &quot;True Level Triggering&quot; (I have it marked in red in the image below).

So your script works fine, just it was not running during the game.