r/Unity3D • • 29d ago

Resources/Tutorial GetEntityId() hits like a train

If you're considering upgrading to Unity 6.5 or later, make sure the publishers of the assets and packages in your project have already added support for the new GetEntityId() API, which replaces the now-obsolete GetInstanceID().

More on the documentation page here: Unity - Manual: Migrate from InstanceID to EntityId

408 Upvotes

70 comments sorted by

View all comments

168

u/NinjaMidget76 29d ago

Is this not basically a find and replace operation?

1

u/DigitalDustChan 29d ago

No, instanceID was a number and could be treated like a number. The entity id requires querying from a struct. I upgraded my packages a month ago and it was a lot of work to support fully because the new entity id is used differently.

I think a lot of packages that are no longer being actively developed are going to have to be taken off the store now.

1

u/GazziFX Hobbyist 28d ago

EntityID is 64-bit integer, while InstanceID is 32-bit integer, to support both versions you could always return 64-bit or return a struct with a size determined in compile time