0
\$\begingroup\$

We have a common Model library where different models/textures are stored. We use this library for our new project. Here is the scenario: Two individuals started separate projects and are now merging them into one. Both of them added models from the common library. However, when they merge their work into a third project by importing each other's package (model/material package), some models lose their materials and appear pink, even though the materials are present and not lost. I tried to identify the problem and found a warning message when importing the same model:

File exists in the project, but with a new different GUID. Will override existing asset...

I discovered that Unity operates models based on GUIDs. So, if two different workspaces added the same material and you attempt to merge them into a single project, only the latest GUID will remain, causing your model to lose the material reference. Is there any available way to recover the material? Or i have to change the workflow, which is not possible.

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

Make sure you enable asset metadata.

Every asset in a Unity project is accompanied by a corresponding file of the same name with the additional extension .meta.

When you exchange assets between projects, copy their corresponding meta-files with them. The meta-file contains the GUID of the asset file of the same name. So when you copy both the meta-file and the asset into the project, then the asset will get the GUID from the meta-file instead of a newly generated one.

The meta-file also contains the import settings, which can also be crucial for certain asset types.

\$\endgroup\$
6
  • \$\begingroup\$ Do you mean i should manually copy the models with meta files instead the pacakge? \$\endgroup\$ Commented May 17, 2023 at 10:01
  • \$\begingroup\$ @MuhammadFaizanKhan What type of "package" exactly are you talking about? \$\endgroup\$
    – Philipp
    Commented May 17, 2023 at 10:21
  • \$\begingroup\$ unity package.. \$\endgroup\$ Commented May 17, 2023 at 10:52
  • \$\begingroup\$ @MuhammadFaizanKhan There are multiple kinds of unity packages. Are you talking about asset packs? Or packages installed via the package manager? (by the way, neither is a recommended way to collaborate in a development team. You should really use a version control software like Git or Plastic) \$\endgroup\$
    – Philipp
    Commented May 17, 2023 at 11:42
  • \$\begingroup\$ I believe the original projects will be pointing at the same asset on disk post-merge, so the question becomes "Which of the 2 meta files do you keep"? \$\endgroup\$
    – Basic
    Commented May 17, 2023 at 15:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .