I’m adding loads of objects to a scene using the ADD OBJECT actuator but I don’t want each of these to sense a collision ( basically a big bulldozer is going to them) and then delete themselves as that slows things down too much.
So I am trying to write a script attached to the Bulldozer (my python is crap) to delete the objects when it touches them.
I’ve got the unique id() thing… which is great but I don’t seem to be able to do anything with it. even if I just try and convert it back to the object name and print it immediately afterwards I get IndexError: from_id(#):id not found in CValueList
So question is:
How do I delete an object from a scene by its id (or is there an easier way)
scene = GameLogic.getCurrentScene()
cont = G.getCurrentController()
S = cont.getSensor(‘sense’)
H = S.hitObjectList
for name in H:
OBID = id(H)
print “new name is”, ob