UPBGE 0.3 Python Script movement




Python Script Below:

import bge

c = bge.logic.getCurrentController()

p = c.owner

keyboard = bge.logic.keyboard
inputs = keyboard.inputs

if inputs[bge.events.AKEY].values[-1]:
p.applyMovement([-0.5,0,0],True)

if inputs[bge.events.DKEY].values[-1]:
p.applyMovement([0.5,0,0],True)

if inputs[bge.events.WKEY].values[-1]:
p.applyMovement([0,0.5,0],True)

if inputs[bge.events.SKEY].values[-1]:
p.applyMovement([0,-0.5,0],True)

Voir sur youtube

KA2Studio
Logo
Compare items
  • Total (0)
Compare
0