Hi. I upgrated Blender 2.58 to 2.62 for my current game project but I have a problem : the actions of my armature dont run after the frame 1. I used script for activate actions and call them. What’s the problem ???
In an other forum, they say the upgrade probably break the link of the actions and i must reload them but that’s doesn’t work…
Thanks for you help. But if I must activate once time the actuator, how do I for the cyclic actions (like walk, run, etc.) ? Because when I maintain a button, the value will always reset… so that’s mean I cannot use one logic brick for many actions ???
import bge
cont = bge.logic.getCurrentController()
own = cont.owner
act = cont.actuators["Action"]
if not "init" in own:
own["init"] = 1
act.action = "default"
cont.activate(act)
UP = bge.logic.keyboard.events[bge.events.UPARROWKEY]
if act.action == "default" :
if UP :
act.action = "walkForward"
cont.activate(act)
elif act.action == "walkForward":
if UP:
own.localLinearVelocity[1] = 5
else:
act.action = "default"
cont.activate(act)
this should work as is.(if not there some syntax error)
with :
one sensors always [true]
one controller script
one actuators action named “Action”
2 action named “default” and “walkForward”
yep ,i tested my script because i use a property(string) of the obj to define the action ,so a bit different and was come some dubt
but work all as expected
plus : can seem a bit annoyng the actuator respect the older version , but for manage a character a bit complex you need to write the code in this way in all cases
then probably not calling ever the actuator should be a advantage as performaces.(teoretical)