Hey Guys!
I’m going to start posting my tutorial scripts to the forum to make it more convenient for you.
If you follow the steps on this YouTube video (http://youtu.be/leYNiNaHtSw) then the script below will work fine (This particular script happens to be for a random object emitter tutorial I created - Blender Game Engine - part 65 - Emitting Random Objects).
(THE ARROWS ARE NOT PART OF THE SCRIPT. DELETE THE ARROWS BUT KEEP THE SAME SPACING)
import bge
import random
def main():
–>cont = bge.logic.getCurrentController()
–>own = cont.owner
–>scene = bge.logic.getCurrentScene()
–>print(scene.objectsInactive)
–>objects = scene.objectsInactive
–>choice = random.choice(objects)
–>print(choice)
–>scene.addObject(choice, own, 50)
main()