Does a UID of an object (array) get reused after a destroy

Get help using Construct 2

Post » Thu Aug 24, 2017 9:30 pm

I am creating an Array, populating it, using the members of the array ("for each X element") then destroying the array.

When I next create an ARRAY it has a UID one larger than the last array created. Is this correct? Do UID's never get reused???
B
5
Posts: 5
Reputation: 235

Post » Thu Aug 24, 2017 10:39 pm

Ashley wrote:In the editor, it does actually recycle UIDs, to keep them low-ish. (Otherwise if you deleted all your objects and added a new one, it would have a high UID - this way it goes back to being low.) However at runtime UIDs keep incrementing by 1 for every new object, they are never re-used. The limit is the integer limit of Javascript's double-precision floating point numbers, which is 9,007,199,254,740,992 (9 quadrillion I think that's called?). Hopefully high enough :P


Only recycled in the layout during development.
Unique during runtime.
Last edited by 99Instances2Go on Thu Aug 24, 2017 11:05 pm, edited 1 time in total.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Aug 24, 2017 10:52 pm

Uid's are given based on the order in which they are created, so they are only unique to each other.
They are recycled as they are destroyed.
Image ImageImage
B
171
S
50
G
180
Posts: 8,394
Reputation: 113,982


Return to How do I....?

Who is online

Users browsing this forum: maranpis, totoe and 24 guests