GameObjects NOT making it to the final build

OK so… new day, new problem (apologies again, because this one is probably out of context).

I was recently testing the build of my game, when I realized something I introduced to my game partially exports the data. In other words, some of the data is there on the hierarchy and makes it to the final build, and some of it is literally instantiated on the spot when the game runs, hence it never makes it to the final build

What can I do to combat this?

Placing the extra information in the PREFAB ITSELF rather than the copy on the hierarchy solved the problem

As a rule of thumb, Unity does not package anything that isn’t referenced in a scene file or from something linked in the scene file. For example, even if something is within a prefab, if that prefab is not referenced in any scenes that are in the build index, the item won’t be packaged.

One exception to this is the Resources folder. You’ll note we take advantage of this with our Inventory System to ensure that all of our inventory items have been included (we access those with Resources.LoadAll())

1 Like

That’s incredibly helpful to know. Thanks once more Brian :grinning_face_with_smiling_eyes:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms