Addressables-Sample icon indicating copy to clipboard operation
Addressables-Sample copied to clipboard

SyncAddressables sample doesn't work 2019.4.17f1 with Addressibles 1.16.16

Open twhittaker opened this issue 4 years ago • 1 comments

The SyncAddress sample code doesn't work when loading multiple prefabs.
Simple Repro: Change the FixedUp code to load 2 cubes and the exception throws with the load percentage at 0.5

Exception: Sync Instantiate has null result Cube
SyncAddressables.Instantiate (System.Object key, UnityEngine.Transform parent, System.Boolean instantiateInWorldSpace) (at Assets/SyncAddressables/SyncAddressables.cs:120)
spawner.FixedUpdate () (at Assets/spawner.cs:35)

Repro:

    if (m_Counter == 10)
      {
        var go = SyncAddressables.Instantiate("Cube");
        go.transform.forward = new Vector3(Random.Range(0, 180), Random.Range(0, 180), Random.Range(0, 180));
        m_instances.Add(go);
        
        go = SyncAddressables.Instantiate("Cube");
        go.transform.forward = new Vector3(Random.Range(0, 180), Random.Range(0, 180), Random.Range(0, 180));
        m_instances.Add(go);

twhittaker avatar Feb 03 '21 19:02 twhittaker

Hi @twhittaker thanks for reporting this! The SyncAddressables project has been removed from the repository. Addressables now supports synchronous loading https://docs.unity3d.com/Packages/[email protected]/manual/SynchronousAddressables.html

kirstenpilla avatar Jan 14 '22 22:01 kirstenpilla