Issue with playAction and addObject in Damage Direction Indicator System (UPBGE)

I’m currently developing a Damage Direction Indicator system in UPBGE. To optimize performance, I’m using addObject to duplicate a template object and store it in a pool for reuse later. Here’s the code I use to set up the pool:

self.damagePool = []
self.damageIndex = 0
self.damageMax = 10

for i in range(self.damageMax):
    damage = self.object.scene.addObject(f"Damage Indicator", self.hud_panel, 0, 1)
    damage.components['Bullethit'].node_name = i
    damage.visible = False
    self.damagePool.append([damage, None])

When I try to play the action using the following code:

material = bpy.data.objects.get(self.object.name).active_material
action = material.node_tree.animation_data.action
self.object.playAction(f'{action.name}', 1, 60, speed=1, layer=2, play_mode=0)

I encounter the following error:

Error: failed to load action: Damage Indicator_node.001
Error: failed to load action: Damage Indicator_node.002
Error: failed to load action: Damage Indicator_node.003
Error: failed to load action: Damage Indicator_node.004
Error: failed to load action: Damage Indicator_node.005
Error: failed to load action: Damage Indicator_node.006
Error: failed to load action: Damage Indicator_node.007
Error: failed to load action: Damage Indicator_node.008
Error: failed to load action: Damage Indicator_node.009
Error: failed to load action: Damage Indicator_node.010

I’ve verified that the animation_data does contain the action name, and the instance object correctly references it. However, playAction fails to load the action.

the second video is what I want it to display. It works because I duplicated that object manually. I don’t want to do like this though. There are so many instance object like this one that I want to do. so I can’t handle that so many amount of object (some can be as many as 100)

Does anyone know why this might be happening or how to resolve it? Any advice or suggestions would be greatly appreciated.

Thank you in advance! :blush:

Test.blend (965.3 KB)