
- Instantly adds a game object to the scene
- game object being added
- Type: KX_GameObject or string
Note:
-
The source object must be on a hidden layer
-
Object is added with the original rotation, scale and position of the source object
- Instantly adds an object to the scene
- game object being added
- Type: KX_GameObject or string
- Object that is being used to add the new game object
- Type: KX_GameObject or string
- Lifetime (in frames) of the object being added
- Type: integer
- 0 = forever
Note:
- The source object (object being added) must be on a hidden layer
- Object is added with the original scale of the source object
- Object is added with the rotation and at the location of other: addObject(object, other, time)

################## instantly add a game object
# import bge
import bge
# get current scene
scene = bge.logic.getCurrentScene()
# get the game object named Tree
object = "Tree"
# instantly add Tree
scene.addObject(object)
################## instantly add a game object
# import bge
import bge
# get current scene
scene = bge.logic.getCurrentScene()
# get the game object named Bullet
object = "Bullet"
# get the game object (an Empty) named Rifle_Muzzle
# I'm using an Empty parented to a game model of a rifle
other = "Rifle_Muzzle"
# set time to 500 frames
time = 500
# instantly add bullet
scene.addObject(object, other, time)