Ending an object

I am trying to delete an object after i add it. Using the edit object i can add and delete. here is how i set it up. I add edit object actuator then use a key to add an object then add another sensor and actuator edit object
to delete the object using another key but all it does after i press the ending object key is stop me from adding new objects i want to delete the object after i added it

digiman

A blend would be helpful

Are the bricks that ends the added object in the object that is to be added? :rolleyes:

Here is the blend i made. What i want is to add blocks(uparrow) then delete those blocks( downarrow)
but that does not happen once the downarrow is pushed the uparrow (adding blocks) does not function
see if you can make it work

digiman

Attachments

AddObjectx.blend (130 KB)

hi digiman,

the problem can be easily solve… put the downarrow sensor to the cube it layer 16 and the end object actuator too…

your problem now is because you did not end the cube but you are ending the empty…

the blend file…

Attachments

AddObjectx.blend (130 KB)

-EDIT- hehe, didn’t notice LinRK’s post…:stuck_out_tongue:

Thank you LinRK, just one small problem just as i add one cube at a time i want to delete one cube at a time, is that possible?

digiman

Sorry, I did not understand what you trying to get…

Does that mean it can’t be done?

digiman

I think it can be done but I don’t really understand what you need…

I just wanted to add an object, example let’s say i add 1 2 3 4 5 objects i want to delete one object at a time,

digiman

Go for python. It’s really easy to do that with scripting.

You can create a global list to store all your created objects (GameLogic.myobjs[]) and then use the method endObject() to kill them (e.g. GameLogic.myobjs[0].endObject() # it will end the first stored/created object). Remember to remove it from the list as well to avoid memory leaks.

Something similar with what we are doing here:
http://blenderartists.org/forum/showpost.php?p=1518491&postcount=8