Search Unity

[Solved] Calling LoadAssetAsync<GameObject> On a prefab is spawning objects into the scene that hav

Discussion in 'Addressables' started by dizzy2003, Apr 23, 2020.

  1. dizzy2003

    dizzy2003

    Joined:
    Nov 25, 2013
    Posts:
    108
    addressables 1.7.5 unity 2019.3.1f1

    I have a hugely complex prefab that contains many other prefabs maybe a thousand gameobjects all together and many mesh renderers and other assorted components

    its an addressable

    I call LoadAssetAsync<GameObject> on its addressable

    Unity loses its mind

    about 4 of the child objects of the addressable actually spawn into the scene the hierarchy shows them as greyed out (see imgur link)

    unity logs errors like these

    https://imgur.com/a/KBP3Qfu

    issue load on mamdef FinalTower (MamDefinition) editorasset: Tower (UnityEngine.GameObject)
    UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object, Object)
    UnityEngine.Debug:Log(Object, Object)
    <LoadEverything>d__11:MoveNext() (at Assets\Scripts\Managers\AddressableManager.cs:117)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)(Filename: Assets/Scripts/Managers/AddressableManager.cs Line: 117)Transform component could not be found on game object. Adding one!
    (Filename: C:\buildslave\unity\build\Runtime/BaseClasses/GameObject.cpp Line: 741)Prefab has multiple Transform components! Removing them automatically would not be safe.
    (Filename: C:\buildslave\unity\build\Runtime/BaseClasses/GameObject.cpp Line: 890)Transform component could not be found on game object. Adding one!
    (Filename: C:\buildslave\unity\build\Runtime/BaseClasses/GameObject.cpp Line: 741)Prefab has multiple Transform components! Removing them automatically would not be safe.
    (Filename: C:\buildslave\unity\build\Runtime/BaseClasses/GameObject.cpp Line: 890)Transform component could not be found on game object. Adding one!
    (Filename: C:\buildslave\unity\build\Runtime/BaseClasses/GameObject.cpp Line: 741)Prefab has multiple Transform components! Removing them automatically would not be safe.
    (Filename: C:\buildslave\unity\build\Runtime/BaseClasses/GameObject.cpp Line: 890)Transform component could not be found on game object. Adding one!
    (Filename: C:\buildslave\unity\build\Runtime/BaseClasses/GameObject.cpp Line: 741)Prefab has multiple Transform components! Removing them automatically would not be safe.
    (Filename: C:\buildslave\unity\build\Runtime/BaseClasses/GameObject.cpp Line: 890)


    then unity editor crashes with a callstack like this. I flip my desk over and give up on addressables forever.



    null ref


    > Unity.exe!GameObject::IsActive(void) Unknown
    Unity.exe!GameObject::Deactivate(enum DeactivateOperation) Unknown
    Unity.exe!DestroyTransformComponentAndChildHierarchy(class Transform &) Unknown
    Unity.exe!DelayedCleanupManager::Flush(void) Unknown
    Unity.exe!LoadSceneOperation::CompleteAwakeSequence(void) Unknown
    Unity.exe!LoadSceneOperation::postLoadSceneAdditive(void) Unknown
    Unity.exe!LoadSceneOperation::IntegrateMainThread(void) Unknown
    Unity.exe!PreloadManager::UpdatePreloadingSingleStep(enum PreloadManager::UpdatePreloadingFlags,int) Unknown
    Unity.exe!PreloadManager::UpdatePreloading(void) Unknown
    Unity.exe!`InitPlayerLoopCallbacks'::`2'::EarlyUpdateUpdatePreloadingRegistrator::Forward() Unknown
    Unity.exe!ExecutePlayerLoop(struct NativePlayerLoopSystem *) Unknown
    Unity.exe!ExecutePlayerLoop(struct NativePlayerLoopSystem *) Unknown
    Unity.exe!PlayerLoop(void) Unknown
    Unity.exe!PlayerLoopController::UpdateScene(bool) Unknown
    Unity.exe!Application::TickTimer(void) Unknown
    Unity.exe!MainMessageLoop() Unknown
    Unity.exe!WinMain() Unknown
    Unity.exe!__scrt_common_main_seh() Unknown
    kernel32.dll!00007fff35eb7bd4() Unknown
    ntdll.dll!00007fff3740ce51() Unknown
     
  2. dizzy2003

    dizzy2003

    Joined:
    Nov 25, 2013
    Posts:
    108
    going back to 1.8.3 seems to have fixed this issue, unsure if I had maybe a cached object somewhere built with 1.8.3 (when I previously tried it) broke 1.7.5 even though I rebuilt data many times with 1.7.5