Search Unity

Prefab componets sometimes have default values instead of saved values

Discussion in 'Unity Build Automation' started by lfg_ryan, Feb 5, 2020.

  1. lfg_ryan

    lfg_ryan

    Joined:
    May 8, 2019
    Posts:
    7
    Has anyone had issues where builds made with Cloud Build have prefabs with default values? I have a game with numerous "bullet" prefabs. They all have a single component, with one object reference, one float, and two bools. Very simple data.

    Some older prefabs when instantiated in-game have default values, not the values I have set and saved in the prefab. Ex. bools saved as true have there default value of false in a Debug.Log in the Awake function before any code executes.

    This happening on both iOS and Android builds. This does not happen with builds made locally on two different machines. This does not happen in the Editor. No exceptions are being thrown in a 10-second window before and after the Instantiate call. The prefabs contents show up just fine on screen, they simply have the wrong (default) values.

    I have tried unpacking and resaving the prefabs, that did not work. I have tried clean builds, that does not work. I am currently trying to recreate the prefabs from scratch.

    Has anyone seen anything like this?
     
  2. margvl

    margvl

    Joined:
    Jan 24, 2020
    Posts:
    3
    I'm facing exact same problem with our custom CI solution... Did you find any workaround for this issue?
    It seems that there are some issues with unity project export through command line..
    I had tried to open exported xCode project and build a game from there but it had the same issues.. When I export/build game through Unity UI then it doesn't have any issues.