Hi, I’m currently experimenting with Addressables. I’m using the default pre-setuped addressable settings and It’s just won’t work after building my project. Using Unity 2020.3.16f1
using System.Collections;
using UnityEngine;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.AddressableAssets;
public class AssetLoader : MonoBehaviour
{
[SerializeField] AssetReference reference;
private IEnumerator Start()
{
var handle = Addressables.LoadAssetAsync<GameObject>(reference);
yield return handle;
if (handle.Status == AsyncOperationStatus.Succeeded)
{
Instantiate(handle.Result);
Addressables.Release(handle);
Debug.Log("Success!");
}
else
Debug.Log("Failed to load!");
}
}
Apologize. The solution of this problem is to build the Addresssable content first (Addresable Groups → Build → New Build → Default Build), then build the actual game. I thought this function was automatic, but it’s not.