has anybody an idea why this script doesn't work? The object "Sphere" is on a separate layer.
"addOne" is a property who generates random integers from 1–10.
import random
from bge import logic
import bpy
cont = logic.getCurrentController()
own = cont.owner
scene = logic.getCurrentScene()
if own["addOne"] == 1:
unitll here the script does work
scene.addObject("Sphere")
or on the other hand, if I run a script that says for example
bpy.ops.mesh.primitive_cylinder_add(radius=1, depth=2, view_align=False, enter_editmode=False, location=(-24.4838, 0.107069, 1.23061e-07), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))
the cylinder doesn't apper in the game itself but only in my 3d view (where you actualy work). Can anybody help me?
thank you in advance, Sputi