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
B
44
S
12
G
13
Posts: 628
Reputation: 10,471

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
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Dec 13, 2011 12:33 am

hey thanks ashley, I'll take a look
B
44
S
12
G
13
Posts: 628
Reputation: 10,471


Return to Construct 2 General

Who is online

Users browsing this forum: Lof, saiyadjin and 10 guests