@mark_r80 The builder you create within animate.createAnimationBuilderFromKeysPath only lives within that callback that you’ve sent in. When you leave the callback, it’s gone, which is why you can’t call play on it later.
To use it, you can put something in that callback that stores the builder as a property of some object that will be accessible to your behavior tree later.
I use this in my knock joke skill. Since I have several animations that will be called again and again, I didn’t want to rebuild them every time. I created a class called “Reactions” that has a method to registerAnimationBuilder. I call this within the createAnimationBuilderFromKeysPath, sending in the builder, and it adds the new builder as a property of my Reaction object.
Later, in my skill I set a notepad.builder to be one of the builders stored in the Reaction object, then play it the notepad.builder.play().
If you want to see the code for this, it’s on my github. In particular look at src/knock-knock/reactions.js to see the code for the Reactions class, then the behaviors/attitudes/react.bt for the behavior tree that creates an instance of the Reactions object, then calls it to return a random builder of a certain type that is passed in to reactions.bt from a different behavior tree.
Code is at https://github.com/chrooke/jibo-knock-knock