multiple copys of an actor all being destroyed when destroy rule is complete

davesfarmdavesfarm Member Posts: 14
edited November -1 in Working with GS (Mac)
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!

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    I would say you have a rule setup wrong or something.

    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?
  • ozonostudioozonostudio Member Posts: 10
    i`m doing something like that and i posted 3 times an i never receive any reply i really don't know why anyone reply me :(
  • davesfarmdavesfarm Member Posts: 14
    not sure the best way to post videos, is there a thread about it? I will look now.. but there is no other events anywhere in the scene, i started very simply by adding the block, physics to them and then the touch to destroy rule, just like you suggest.

    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?
  • davesfarmdavesfarm Member Posts: 14
    OK I confirmed that it IS something in the file that is causing it. I created a new clean file and just put a ball in it and a rule to destroy on touch... placed a couple of them, hit play and touched one. Only one was destroyed.

    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!
  • Mcreator83Mcreator83 Member Posts: 120
    i would do it like this. create an attribute and name it destroy and leav it at 0

    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
  • ozonostudioozonostudio Member Posts: 10
    this guy are asking for a chain reaction
Sign In or Register to comment.