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
45
S
12
G
13
Posts: 628
Reputation: 10,481

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
373
S
218
G
84
Posts: 23,553
Reputation: 186,408

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
45
S
12
G
13
Posts: 628
Reputation: 10,481


Return to Construct 2 General

Who is online

Users browsing this forum: funkyos and 4 guests