multiple copys of an actor all being destroyed when destroy rule is complete
davesfarm
Member Posts: 14
Hey guys, I am new so this may be a dumb question but I cant for the life of me figure out what Im doing wrong. I have looked at the demos and i dont see any instances that prevent this from happening in them.
I have a block, that when you tap it gets destroyed.
I have placed say, 9 of them in the scene.
When I tap on any of the 9 blocks, ALL are destroyed. When what I want is for that single block to be destroyed.
Seems silly to, for every instance have to set up that destroy individually... I am sure there is a way for this to work, just cant figure it out.
A great example of this not happening is in the shoot em up demo, when you shoot 1 ship, in my case it would destroy every ship on the screen! why is this not happening in the demo? i cant figre it out.
Thanks!
I have a block, that when you tap it gets destroyed.
I have placed say, 9 of them in the scene.
When I tap on any of the 9 blocks, ALL are destroyed. When what I want is for that single block to be destroyed.
Seems silly to, for every instance have to set up that destroy individually... I am sure there is a way for this to work, just cant figure it out.
A great example of this not happening is in the shoot em up demo, when you shoot 1 ship, in my case it would destroy every ship on the screen! why is this not happening in the demo? i cant figre it out.
Thanks!
Comments
In the Block you want to destroy you need to have a rule
if Actor Receives Event Touch is Pressed
--Destroy
Thats the most simple way to do it. now if your triggering based on an attribute or something you could have something crossed where they are all triggering at once but a simple touch is pressed rule should only apply to that instance
The only thing I can see messing with this is if you are trying layer them on top of each other. In that case they are all being touched when you press the top one.
Can you post a video?
then i drag the actors onto the scene, place them wherever i want.. hit play to test, touch one.. and they all disappear...
not sure, if its because they are on the same layer or something? how can i check that?
so it should have worked, if you come across this thread and you have the same problem, its probably an atribute you made thats making them linked or something on accident.
good luck and thanks!
next make a rule in each one of the object that you want to destroy.
next put actor receive event on touch pressed
place a change attribute from game.destroy to game.destroy+1
make another rule and put game.destroy = 1
destroy
that should do it and it will destroy all actors that has this in it.
if you put destroy on touch in each actor it will only destroy the actor you touch.
hope this helps