Search Unity

Migrating and replacing direct GameObject references

Discussion in 'Addressables' started by CW3MH6, May 2, 2019.

  1. CW3MH6

    CW3MH6

    Joined:
    Jul 4, 2013
    Posts:
    14
    I'm having trouble understanding how to replace direct GameObject references in 3rd party assets and things like GPU Instancer, Vegetation Studio Pro, etc., with versions that are addressable (or even just in asset bundles). For instance, I'd like to put all the trees and foliage assets into its own group/bundle, and just load them in when the scenes load. I can't seem to do this, however. I mean I can add them to a group, but I can't actually utilize them.

    Also want to rant a bit.

    Is there a reason the addressable system can't just take the original GameObject's GUID, and load in the appropriate bundle/prefab at runtime, automatically under the hood? I don't understand why these systems require so much additional work just to load an asset. They only seem like they are relevant for extremely simple mobile games, not complicated PC games that are already far into development. Unity should be able to know what asset is where, I shouldn't have to do this book keeping myself.

    I wouldn't even be bothering but apparently Unity has a ridiculous 4GB limitation somewhere that is causing our build to break randomly now. Why Unity can't split up resources itself, I have no idea. Why this is still an issue in 2019, I have no idea. The simplest solution would be to just keep prefabs in the main project and store the relevant textures/models in its own archive and load them as needed. I do not need the ability to download assets at runtime or any other such mobile features. I just need the ability to split up resources so it doesn't hit the 4GB limit. Which, again, Unity should just handle itself.

    So if someone could enlighten me into how this is supposed to work in more than just a tech demo capacity, please do. Sorry if this comes across the wrong way, but it is extremely frustrating when Unity randomly breaks halfway through a project and the only solution seems to be "redesign from the ground up".
     
    faolad and JesOb like this.
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    To answer your main question, you need to set the top level thing (scene, prefab, whatever) that points to your third party content as addressable. And load it that way (meaning if it's a scene, it can't also be in the scenes list).

    as to the rant, yeah, a bunch of that is a pain, and we're doing what we can to fix it.