So unrelated to the last question I asked…
I’ve been trying to simplify my cluttered logic brick mess by simply converting the walking functions to python scripts. I’ve encountered an issue. I’ve refrained from using the sensors in the logic bricks and instead use Game Keys(bge.events). I’ve got the motion covered but it won’t play any animations.
Code
import bge
def main():
cont = bge.logic.getCurrentController()
owner = cont.ownerkeyboard = bge.logic.keyboard
mouse = bge.logic.mouse
scene = bge.logic.getCurrentScene()
armature = scene.objects[‘Player.Rig’]#move up down, turn left right
if bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.DOWNARROWKEY]:
owner.applyMovement((0,-.2, 0), True)
armature.playAction(“PlayerWalking”, 1, 30, 0, 2, BLEND, PLAYTYPE, LYRWGHT, IPO_FLG, SPEED, BLENDTYPE)if bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.RIGHTARROWKEY]:
owner.applyMovement((0, 0, .05), True)if bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.LEFTARROWKEY]:
owner.applyMovement((0, 0, -.05), True)
main()