By using cell Fracture, I broken down a plane named ‘glass’ into 80 sub parts having names
glass_cell.001,
glass_cell.002,
glass_cell.003,
.
upto
.
glass_cell.080
I’ve tried it using loop as follow…
def shoot(cont):
own = cont.owner
scene = own.scene
mouse = cont.sensors[‘MOUSE_BRICK_NAME’]
if mouse.positive:
for i in range(0,80):
if i==0:
scene.addObject('glass_cell','Empty', 360)
else
if i<10:
scene.addObject('glass_cell.00'+i,'Empty', 360)
elif i<100:
scene.addObject('glass_cell.0'+i,'Empty', 360)
else:
scene.addObject('glass_cell.'+i,'Empty', 360)
But it’s not working.
Please Help.