After many tests,maybe those 3 following infos could help some of you to get good results in animation with Logic Nodes & Actions:
1/ for each Action you have in the Action Editor, if you use bones in Armature, be sure that for each keyframe in Pose Mode, you did the “I” and “Whole Character” , otherwise strange behaviors can appear …
2/ using this thereafter “Play Action with Params” node can be helpful to control animations

code for the blender.py
class PlayActionParamNode(Node, ArmLogicTreeNode):
‘’‘Play action Param node’‘’
bl_idname = ‘LNPlayActionParamNode’
bl_label = ‘Play Action with Params’
bl_icon = ‘GAME’
def init(self, context):
self.inputs.new('ArmNodeSocketAction', 'In')
self.inputs.new('ArmNodeSocketObject', 'Object')
self.inputs.new('ArmNodeSocketAnimAction', 'Action')
self.inputs.new('NodeSocketFloat', 'Blend')
self.inputs.new('NodeSocketFloat', 'Speed')
self.inputs.new('NodeSocketBool', 'Loop')
self.inputs[-1].default_value = 0.2
self.outputs.new('ArmNodeSocketAction', 'Out')
self.outputs.new('ArmNodeSocketAction', 'Done')
then the code for the new Node
package armory.logicnode;
import iron.object.Object;
import iron.object.BoneAnimation;
class PlayActionParamNode extends LogicNode {
public function new(tree:LogicTree) {
super(tree);
}
override function run() {
var object:Object = inputs[1].get();
var action:String = inputs[2].get();
var blendTime:Float = inputs[3].get();
if (blendTime == null) blendTime = 0.2;
var speed:Float = inputs[4].get();
var loop:Bool = inputs[5].get();
if (loop == null) loop = false;
if (object == null) return;
var animation = object.animation;
if (animation == null) animation = object.getParentArmature(object.name);
animation.speed = speed;
animation.loop = false;
var loop = false;
// .... cf. anim.play(s, null, blend, speed);
//trace(' --- action=${action} .');
//trace(' --- blendTime=${blendTime} .');
//trace(' --- speed=${speed} .');
//trace(' --- loop=${loop} .');
animation.play(action, function() {
runOutputs(1);
}, blendTime, speed, loop);
runOutputs(0);
}
}
3/ if not already used, considering the use of the node Animation State is helpful to follow what’s going wrong
exemple of usage
