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

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
362
S
216
G
75
Posts: 23,071
Reputation: 180,354

Post » Tue Dec 13, 2011 12:33 am

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


Return to Construct 2 General

Who is online

Users browsing this forum: Aphrodite and 7 guests