Let’s say that the problem is: “tool” is not in active layer when “instanciador” initiates its controllers, so the “open” actuator of “tool” never gets bound, not even later on when “tool” becomes alive. There are like a ton of “what” that follows this assumption but let’s not dive deeper, we want to make games.
Otherwise everything would be perfectly fine with your setup (just activate both layers in the scene, run the game and you’ll see your animation up and running) but there is this thing and it doesn’t work.
Because tool is an inactive layer, you have to control the animation in some other way.
One way is using the script to play the action, bypassing entirely the “open” actuator. You remove it, then the script becomes:
from bge import logic as GL
instanciador = GL.getCurrentScene().objects['Instanciador']
object = GL.getCurrentScene().addObject('tool', instanciador)
object.playAction("Key.002Action.001", 150, 170)
Another way is to separate the actuator “open” from the controller “Python” and using it with a controller bound to “tool”, like:
add a game property to tool named “play action”, of type Boolean, the create a brick like:
sensor -> Property “play action” Equal “True”
controller -> and
actuator -> the “open” actuator.
The script becomes:
from bge import logic as GL
instanciador = GL.getCurrentScene().objects['Instanciador']
object = GL.getCurrentScene().addObject('tool', instanciador)
object["play action"] = True #<- this is the right call
#Argh mistake
#object.playAction("Key.002Action.001", 150, 170, play_mode=GL.KX_ACTION_MODE_PLAY)
Update: copy-paste is the root of all evils