[SOLVED] Destroying two objects associated simultaneously?

Get help using Construct 2

Post » Thu Nov 26, 2015 10:13 pm

Hi C2 fellas!

In my game, there is an enemy that leaves an obstacle every one second, causing the defeat of the player when they collide. Because this game has isometric perspective, a small invisible object is also left on the floor just below this obstacle to simulate a 3D collision. As the player can destroy this obstacle, I want this little object is also destroyed when the obstacle is destroyed.

I tried this using the "Pick top instance" when the obstacle is destroyed, but not working 100%.

Does anyone have any suggestions on how to solve it?

Thank you in advance the attention and collaboration of all.
Last edited by lukezero on Sat Dec 12, 2015 5:12 pm, edited 1 time in total.
B
33
S
6
G
1
Posts: 217
Reputation: 2,797

Post » Thu Nov 26, 2015 10:15 pm

Store the UID of the "other" object and them pick & destroy by that UID.
ImageImageImage
B
71
S
20
G
189
Posts: 3,531
Reputation: 107,836

Post » Thu Nov 26, 2015 10:16 pm

Can you put them in a container together?
B
102
S
38
G
17
Posts: 953
Reputation: 16,941

Post » Thu Nov 26, 2015 11:44 pm

Thanks for the tip, @blackhornet.

I'll try it! ;)
B
33
S
6
G
1
Posts: 217
Reputation: 2,797

Post » Fri Nov 27, 2015 12:25 am

A Container may also work, if you don't need the association back to the original enemy.
ImageImageImage
B
71
S
20
G
189
Posts: 3,531
Reputation: 107,836

Post » Fri Nov 27, 2015 2:34 am

@blackhornet and @C-7, the Container may work with my game.

How it works in C2?
B
33
S
6
G
1
Posts: 217
Reputation: 2,797

Post » Fri Nov 27, 2015 3:11 am

Just select your obstacle and click on Container to add your invisible sprite. Now whenever you make the obstacle, the invisible sprite will be automatically created. Same for destroying.
ImageImageImage
B
71
S
20
G
189
Posts: 3,531
Reputation: 107,836

Post » Fri Nov 27, 2015 2:23 pm

Thanks again, @blackhornet and C-7! It worked! :D
B
33
S
6
G
1
Posts: 217
Reputation: 2,797


Return to How do I....?

Who is online

Users browsing this forum: Lancifer, LaurenceBedford, legendaryarcane, Magistross, randomly, Yahoo [Bot] and 12 guests