Using python to tell another object to emit and object.

I have a group of empties that I would like to use as emitters. Each one should be used randomly. For that I have:


# limit amount that can spawn
if count < 10:
    x = randint(1, 10)
    ID = str(x)
    emitterUsed = 'Emitter' + ID
    # have emitterUsed spawn the object

Is something like this possible? If anything, I would like to avoid setting up 10 different messages. :confused:



scene = bge.logic.getCurrentScene()
emitted_object = scene.addObject('object_name', emitterUsed)
#I add this next line
emmited_object.worldPosition = emitterUsed.worldPosition


Thanks! Don’t don’t forget the other ‘m’ though in the first emmitted_object.

you don’t need the line
emmited_object.worldPosition = emitterUsed.worldPosition

with addObject, the added object automatically gets orientation and position from emitterUsed