How to copy BGE logic from one object to another using script?
I use the following code (coppied from an addon) to create a duplicate of an object ...
def copyObject(scene, name, copyobj, location ):
# Create new mesh
mesh = bpy.data.meshes.new(name)
# Create a new object.
ob_new = bpy.data.objects.new(name, mesh)
ob_new.data = copyobj.data.copy()
ob_new.scale = copyobj.scale
ob_new.location = location
scene.objects.link(ob_new)
return ob_new
But this does not copy the game logic from the original object.
Thanks!
copy()
but you can step through the properties of each brick and recreate them. $\endgroup$