# How to activate ANOTHER object's actuator (Python)?

Normally, we activate actuators like this:

controller = logic.getCurrentController()
controller.activate(actuator)


This activates the actuator called "AddObject" that belongs to the current controller.

But let's suppose that I want my scene manager to tell objects to delete themselves. The "End Object" actuator has to be on the object to be deleted, not the object that's doing the deleting (unlike the Add Object). I add an "End Object" actuator called "EndObject" to the object I want to end, and then I use:

scene = logic.getCurrentScene()
cont = logic.getCurrentController()
for obj in scene.objects:
if obj.name == "Critter":
obj.actuators["EndObject"]
....


... and then what? Using:

act = obj.actuators["EndObject"]
obj.activate(act)


...doesn't work because obj doesn't have a function called activate, nor anything similar that I can find.

Any ideas? Am I using "End Object" incorrectly?

You do not do that. It is not supposed to "remote control" objects that way.

You can indeed connect logic bricks of different objects. But this quickly ends in a chaotic mess.

You can delete objects via endObject(). In difference to the actuator this does not need to be called by a controller of the object to be deleted.

Your sample could look like this:

import bge
scene = bge.logic.getCurrentScene()

for object in scene.objects:
if object.name == "Critter":
object.endObject()
...

• I suspected it was something like "you're not supposed to do that" ;-) Thanks!
– Matt
Jul 18, 2017 at 12:14
• Hi Monster. I really want to know :) blender.stackexchange.com/questions/97394/… Dec 28, 2017 at 13:41
• Yes, this is another way to deal with such a situation. Jan 2, 2018 at 13:08