I’ve got a script that will create a new empty wherever and whenever I right click. I have another script that tells an object (“test object”) to move towards the last created empty. for some reason I can’t get the old empties to be removed. all the empties have the same name (“target”), which is a problem when using endObject(). they have different ID’s, but I’m having trouble deleting objects by their ID.
the empties were getting deleted, but I was creating them faster than I was deleting them. every time you have something like “addedEmpty = scene.addObject(empty, spawnPoint, 100)” it creates an empty and assigns it to to a variable. I thought it just assigned the last one to a variable. my code looked something like this:
scene.addObject(empty, spawnPoint, 100)
addedEmpty = scene.addObject(empty, spawnPoint, 100)