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

0 favourites
  • 3 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • 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???

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

    Only recycled in the layout during development.

    Unique during runtime.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)