How do I destroy an instance of an object

Get help using Construct 2

Post » Fri Jan 24, 2014 6:51 am

Hey,

I have an object sprite that is repeated more than twice.

How can I destroy a specific instance of that object when an event happens?

Right now I can only make it destroy the object, removing all of them.

I want it to destroy a specific instance of the object.

Can this be done with UID?

Please enlighten me!

Thanks!novs122014-01-24 07:29:13
B
4
Posts: 14
Reputation: 228

Post » Fri Jan 24, 2014 7:33 am

you have to pick the instance in the event which controls the destroying.

If you don't tell Construct2 which instance you mean it will perform the actions on all instances.

There are a number of ways to do the picking.
If you are comparing an instance variable, usually a system for each event will solve your problems.

you could also just put the check as a subevent of the event where the instance variable is changed, for the right instance should already be picked in that event.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jan 24, 2014 7:36 am

The issues would be found how you have set up your Events to flow...

Please post your Capx or event sheet screenshot so we can see whats going on and address the specific problem....What you explained doesn't seem to follow standard instance behaviour in Construct 2


When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
35
S
13
G
8
Posts: 318
Reputation: 7,685

Post » Fri Jan 24, 2014 10:07 pm

https://dl.dropboxusercontent.com/u/84259828/example.capx

There is a capx link to a very basic scenario of what I want.

Instead of the block the ball is hitting breaking, how can I make it so one of the blocks to the right destroy instead?

If you want to just edit the capx and re-upload it that's fine!
Or you can just explain here!

Thanks!novs122014-01-24 22:10:29
B
4
Posts: 14
Reputation: 228

Post » Mon Jan 27, 2014 3:14 am

Anyone know the solution to this?
I provided a .capx for you in the post above.

Thanks!
B
4
Posts: 14
Reputation: 228

Post » Mon Jan 27, 2014 3:30 am

Umm, I just downloaded the .capx and it seems to be working as you want it to.

Your events are also correct.Tekniko2014-01-27 03:32:20
B
56
S
15
G
13
Posts: 826
Reputation: 17,705

Post » Mon Jan 27, 2014 4:02 am

@Tekniko
Hey, sorry for any confusion

But I want the following to happen:

Instead of the block the ball is hitting breaking, how can I make it so one of the blocks to the right destroy instead?
B
4
Posts: 14
Reputation: 228


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 11 guests