UID/IID Use!??

Get help using Construct 2

Post » Thu Oct 24, 2013 6:52 am

I am confused about the usage of IID and UID at runtime.

Basically i need to destroy an object's instance(out of multiple instances) using a button.
Every time i click the object and then click the destroyer button the object's last clicked instance should be destroyed.

I am not sure how to use IID or UID for 'picking' and then destroy the object.



B
3
S
1
Posts: 3
Reputation: 331

Post » Thu Oct 24, 2013 6:55 am

Unable to Post LINKS!
B
3
S
1
Posts: 3
Reputation: 331

Post » Thu Oct 24, 2013 6:57 am

One way to do it would be this:

variable lastTouched

On object clicked
.. set lastTouched : object.UID

On button clicked
pick object by UID lastTouched
.. object destroy


So every time you click on object you save the objects UID to a variable. When a button is pressed, we pick the object indicated in variable and destroy it.
B
24
S
9
G
7
Posts: 756
Reputation: 7,312

Post » Thu Oct 24, 2013 7:20 am

Thanx.It worked.
B
3
S
1
Posts: 3
Reputation: 331


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 24 guests