Problems with destruction some objects

0 favourites
  • 3 posts
From the Asset Store
Per Pixel Destruction like in "Worms" (perfect performance, no third party plugins)
  • Good everybody; I have a problem when destroying an object.

    I tell you; the game is very simple; we have to shoot with the mouse (put it on top) and it destroys the object. That works easily.

    We have options to create distractions, that is to say a target that if you touch it will subtract points; generating the distractions is not a problem either, they are generated, and when I break the correct stimulus, this and the distraction stimulus are generated again.

    The problem comes when trying to destroy the distraction stimulus; imagine that there are 3 distraction stimuli and 1 good one, with the way I have done it, all of them should be destroyed but only the one I am putting the mouse on is destroyed. What I want is that when I am on top of that one, all of them are destroyed, like with the good one, and although I have replicated the same code, it doesn't behave the same way.

    Any idea what can happen or how to make that when the cursor is on the distraction target all of them disappear.

    Thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I think I understand the problem. When you use mouse cursor over object it picks the single instance of the object for the actions, so it will only apply destroy to the one the mouse is over.

    To fix you can create a sub-event 'System > Pick all distraction objects'. This opens up all of your instances to be picked again. Then if you apply destroy action from this sub-event it will destroy all of the instances.

    The reason it works with destroying the good ones is because good object was not picked on the left with cursor action, so it did not narrow the selection. So this will automatically destroy all good objects because you did not specify, so that's fine.

  • tHANKS A LOT

    its solve,

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)