SyncAddressables sample doesn't work 2019.4.17f1 with Addressibles 1.16.16

Open
#48 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
csharp, unity
Domain
game-dev

Research direction

Start with Assets/SyncAddressables/SyncAddressables.cs at line 120 and the reproduction in Assets/spawner.cs at line 35. Run the sample with Unity 2019.4.17f1 and Addressables 1.16.16, changing the update code to instantiate two Cube prefabs. Done means both loads complete without the null-result exception when progress reaches 0.5.

Written by the indexing model from the issue text.

Description

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);
Dominant language
C#
Stars
1.5k
Forks
303
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Unity-Technologies/Addressables-Sample

All issues in Unity-Technologies/Addressables-Sample

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.