increment variables for instance

Discussion and feedback on Construct 2

Post » Mon Dec 12, 2011 8:51 pm

Hey,

Where can I declare in runtime.js, a variable which will be incremented in order to be used for instance creation. I would like to be able to assign an incremented ID to each instance...
Thanks for helping
Passionate developer

If my work helped you to make your project, please consider making a donation :)
B
44
S
12
G
14
Posts: 631
Reputation: 10,987

Post » Tue Dec 13, 2011 12:28 am

How about using the UID? inst.uid is exactly that, a number Construct 2 assigns to each instance on creation which increments by 1 each time.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,772

Post » Tue Dec 13, 2011 12:33 am

hey thanks ashley, I'll take a look
Passionate developer

If my work helped you to make your project, please consider making a donation :)
B
44
S
12
G
14
Posts: 631
Reputation: 10,987


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests