Pick last instance

Get help using Construct 2

Post » Sat Apr 14, 2012 5:27 pm

How do I have the system pick the last instance of an object and have it destroy? I want to create a sticker dropdown bar that destroys itself when you press "done" however, I have the stickers events like this...

sticker on dragdrop "drop" ----------- system create object "sticker" at (some position on the dropdown bar)

on "done" pressed --------------- sticker destroy

But that destroys all of the stickers... help please :(StephenC2012-04-14 17:31:26
B
20
S
4
G
4
Posts: 129
Reputation: 5,545

Post » Sat Apr 14, 2012 5:32 pm

Might try "Pick Nth" using sprite.count.
That's zero based, so will probably need a +1 in there too.
Image ImageImage
B
165
S
49
G
147
Posts: 8,048
Reputation: 96,588

Post » Thu May 11, 2017 10:18 am

Actually "-1"

PickNTh Instance ->
SpriteName.Count - 1
B
4
Posts: 1
Reputation: 204


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], DaniellMesquito, PauloMarcio, repkino and 5 guests