Pinned Objects clones get destroyed simultaneously. Why?

Get help using Construct 2

Post » Sun Dec 11, 2016 7:49 am

I'm pretty new in the use of Construct2 and in gamemaking in general. I'm just trying to grasp the basics first.

So my problem is, I pinned two objects together. The object on top is like an armor that opens and closes and cannot be destroyed. The object below that has a health instance variable. I already set it up so that when the bottom object gets destroyed, the armor gets destroyed too. It works fine.

But when I made copies, things turned bad. When I destroy Object 2, all instances of object 1 (armor) gets destroyed. How do I fix this?

Also, I set those objects to get destroyed outside of the layer. When they were multiplied, whenever the first pair gets destroyed, the other pairs lose their pins and the armor leaves the bottom object.

I hope you could help me with this one. Thanks!
Posts: 1
Reputation: 352

Post » Sun Dec 11, 2016 1:11 pm

You should check the item before destroying it, otherwise, any of that item will be destroyed, because you said it, destroy all items of that type, while not giving the system a path to select the right item.

If you want avoid it, try checking what item was hit and pick it in the event.

Something like this:
Sample CAPX: ... ullet.capx

After picking the correctly object, you can make one less step by working in another way.

Making a container. It's smart because everything inside the container will be destroyed, so, any armor or weapon spawned by that object will be destroyed with him.
Posts: 1,387
Reputation: 22,909

Return to How do I....?

Who is online

Users browsing this forum: mekonbekon and 61 guests