Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision |
globalobjectid [2021/02/10 23:39] – uninomiconadmin | globalobjectid [2025/01/15 04:35] (current) – external edit 127.0.0.1 |
---|
++++ | ++++ |
| |
===== Bug: GlobalObjectIdentifiersToObjectsSlow ===== | ===== Bug: Querying deleted objects ===== |
Sometimes ''GlobalObjectId.GlobalObjectIdentifiersToObjectsSlow'' will return incorrect objects. For example, in this case, when passed an array of only scene objects((All GIDs from a scene object have a 1 at the front)): | When calling ''GlobalObjectId.GlobalObjectIdentifiersToObjectsSlow'' with a GlobalObjectId that was assigned to a now-deleted object, the Object returned will sometimes be a valid, arbitrary Object in the project, rather than the correct value of ''null''. |
{{ ::is0bzbpnb6.png?direct |}} | |
| |
The function will return non-scene objects (the shader editor asset at 205). | For example, in this case, when passed an array of only scene objects: |
{{ :is0bzbpnb6.png?direct |}} | {{ :hdmvjaumtf.png?direct&400 |}} |
| |
| The function will return non-scene objects (the shader editor asset at 205). |
| {{ :is0bzbpnb6.png?direct&400 |}} |
| |
| This seems to be a bug. The correct result should have been ''null'', because that GID was deleted. |
| |
| I have had some luck <sup>[//[[:wiki:tag:dark-magic|dark magic]]//]</sup> querying these 'bad' GIDs individually with ''GlobalObjectIdentifierToObjectSlow''. This seems to properly return null in certain cases. This does not cure all cases, however((Luckily, there was only a small set of objects that were valid to be stored by my GIDs, and so I could discard any GIDs resolving to the wrong type.)). |
| |
| Update: This is fixed in 2021.1 [[https://issuetracker.unity3d.com/issues/globalobjectidglobalobjectidentifierstoobjectsslow-sometimes-returns-a-random-existing-gameobject|bug tracker]]. |
| |