Search Unity

The "Build Player Content" button is missing. The game does not spawn objects.

Discussion in 'Addressables' started by Lesnikus5, May 3, 2020.

  1. Lesnikus5

    Lesnikus5

    Joined:
    May 20, 2016
    Posts:
    131
    I'm trying to get used to addressable. Everything works fine in the editor, but when I build the game, the objects do not appear. I read in the manual that it is necessary to build content before building the game.

    Building your game
    Addressables needs to build your content into files that can be consumed by the running game before you build the player. This step is not done automatically. You can build this content via the UI or API.

    1. UI a. Open the Addressables window. b. Select Build->Build Player Content
    2. API a. AddressableAssetSettings.BuildPlayerContent()

    But I do not have a "Build Player Content" button in the Addressables window. Where did she go?
    I used Unity 2019.2.17f

    button.jpg

    I use very simple code to generate objects, when playing in the editor everything works, after building the game, no.

    Code (CSharp):
    1.  
    2.  
    3.         void SpawnAddressables()
    4.         {
    5.             for (int i = 0; i < cycles; i++)
    6.             {
    7.                 Vector3 pos = new Vector3(Random.Range(-100f, 100f), Random.Range(-100f, 100f), Random.Range(-100f, 100f));
    8.                 Addressables.InstantiateAsync("Cube1", pos, Quaternion.identity).Completed += handle =>
    9.                 {
    10.                     list.Add(handle.Result);
    11.                 };
    12.             }
    13.         }
     
  2. Lesnikus5

    Lesnikus5

    Joined:
    May 20, 2016
    Posts:
    131
    Help still needed.
     
  3. PacoLabs

    PacoLabs

    Joined:
    Jun 29, 2017
    Posts:
    31
    To my understanding, in their UI, "Default Build Script" is the new "Build Player Content"