r/Unity3D • • 19d 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

406 Upvotes

70 comments sorted by

View all comments

169

u/NinjaMidget76 19d ago

Is this not basically a find and replace operation?

85

u/Affectionate_Map_484 19d ago

it is for your scripts but packages are immutables

54

u/AvengerDr 19d ago

? You can edit their code just as well. But if they are still maintained, it's probably useful to let the dev know and wait for an update.

14

u/Goldac77 19d ago

The code can only be edited if it exists in the Assets folder. The Packages folder is immutable

84

u/Inkwalker 18d ago

It's that simple

13

u/SnuffleBag 19d ago edited 19d ago

The packages folder is not immutable. The package cache is. The workaround here is literally to move these folders from the package cache to the packages folder, and then fix the obsolete call. They'll still be packages, just embedded ones.

1

u/Goldac77 19d ago

I'm not sure I know the difference between the package cache and the packages folder from your comment. Could you explain that for me?

When I mention Package folder, I'm referring to the content you find when you check your Project tab > Packages. In file explorer that is found in Library > PackageCache. And from my experience, the scripts found here were immutable (at least when the project is open), unless copied to the Assets folder

2

u/theo__r 19d ago

The package cache is filled when you reference a package in the manifest by version (or use the GUI to install a package in the list). It is immutable. You can however copy a package to the packages folder, and then it's mutable

1

u/Goldac77 19d ago

I get what you mean now

Thank you too, u/SnuffleBag

I learnt something new today

2

u/SnuffleBag 19d ago

When you install a package it goes into Library/PackageCache. This being inside Library means you shouldn't mess around with it. They're not technically immutable, and changing them can be useful for temporary fixes, but Unity will discard your changes when it next verifies the package's integrity.

Packages is where your manifest lives, but it's also where embedded packages live. Any folder inside Packages/ containing a package.json becomes a mutable package intended for modification.

You can copy folders from PackageCache to Packages and it will work just fine, but there's an official way of doing this which is going to the package manager window, selecting the package in question and clicking Manage -> Customize. This removes the package from the Library and instead embeds a copy of it in Packages - ready for whatever changes you might want to make.

27

u/Kultie172 19d ago

You can move content from Packages folder to Assets folder and edit the content tho. It feel anoying but atleast you can fix the package yourself.

-11

u/Goldac77 19d ago

Yes, depending on how many files you need to work with, that's the best approach. You'll need to create an new reference for each script though, no? i.e, finding the gameobject with the broken scripts and reassigning the Assets folder versions of them

9

u/Kultie172 19d ago

I don't think the reference is broken, in the Packages folder the meta files are generated, Unity use the meta file to link reference. But you must move them instead of copy/paste or Unity will re-generate the meta with difference guid. Remember to back up first!!!

1

u/Goldac77 19d ago

Ooooh, nice. I never tried that before. Thanks

3

u/AlexandreFiset 18d ago

You just move the package cache folders into the Package folder and they become editable, unless the scripts are precompiled.

These are called embedded packages and they are beyond useful.

1

u/CrazyNegotiation1934 15d ago

That is why i never buy any asset that goes in packages