Armature actions with python 2.55

I’m trying to make my game character in bge, using python have a action play rather then using action actuators from logicblocks. I’m still not used to reading the API yet, does anyone know how to do this?

like if i hit w to make a person do the walkcycle action in python.

Still not able to figure it out with even using a logic actuator and some python. I’m sure its a small thing i missed.

could someone take a look at my blend file and see what needs to be fixed/added?

Attachments

PythonAction.blend (477 KB)

I changed the script. Now it is working.

Attachments

PythonAction1.blend (476 KB)

wow thanks a lot! I didn’t know about activate (not even sure were it is in the API), so im guessing con.deactivate(arm) would stop the animation in place if needed?

This is correct. Controller activate and deactivate actuators (regardless of the controller type). Some actuators deactivate themself when they are done, with their work (e.g. property actuator).