How do I destroy by UID

Get help using Construct 2

Post » Mon Nov 24, 2014 9:06 pm

So I've told the game to find a sprite with UID 1089 but when I add an event to destroy another sprite I can't figure out how to destroy by UID

Thanks in advance ;)
A box isn't a box without 6 sides.
B
18
S
3
Posts: 26
Reputation: 1,785

Post » Mon Nov 24, 2014 9:08 pm

object:pick by unique ID(1089)
object:destroy
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Nov 24, 2014 9:08 pm

Yeah its not quite that but I just figured it out :P Thanks anyways quick response too :D
A box isn't a box without 6 sides.
B
18
S
3
Posts: 26
Reputation: 1,785

Post » Mon Nov 24, 2014 9:28 pm

For anyone wondering, you'll need to pick instance by evaluation to do that (for example, when a bullet collide with the instance, you can pick instance by evaluating which instance the bullet is colliding with). If you don't specify what the conditions are for picking, you'll end up with unintended results.

To destroy specific instances (that have a known ID), then what Codah said works fine.
B
20
S
8
G
4
Posts: 195
Reputation: 3,555

Post » Mon Nov 24, 2014 9:45 pm

Uid's get recycled btw.
They're only unique as long as they exist.
Image ImageImage
B
168
S
50
G
164
Posts: 8,232
Reputation: 105,583

Post » Wed Dec 10, 2014 2:13 pm

I just wanted to know how to delete a specific object not when something collides with it :P I figured it out you just create a sub event after telling it to pick by unique ID and then tell it to destroy the object. Thanks anyways :)
A box isn't a box without 6 sides.
B
18
S
3
Posts: 26
Reputation: 1,785


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound, RobertMKD, Syazanie Amirin and 10 guests