Search Unity

Game Objects disappearing when building project

Discussion in '2D' started by Malmarthur, May 31, 2019.

  1. Malmarthur

    Malmarthur

    Joined:
    May 31, 2019
    Posts:
    4
    My friends and I are working on a 2D Rogue-Lite project. The deadline is this Sunday, and this morning everything was fine. In our game, we have items that appear in certain rooms, and when you are close to them, a box of text appears (the item's description) and if you press 'E', you pick the item up. So, here is my problem:
    when I build, I can't see the items anymore, although I can see them in EDIT mode. Pressing 'E' where they should be doesn't work either (it doesn't change my stats as it normally should). However, that's only on my portable computer. On my other computer, the build works well, same goes for my friends. I asked my friend to send me the installer he made for the game, and I used it to execute HIS build. Same problem, I couldn't see the items.
    I am lost, I don't know what's the problem. I could find some questions online about objects not being visible in build, but most have no answers.

    edit: Unity version is 2019.1.0f2

    edit 2: After comparing the AppData / Local / Unity / Editor / Editor.log from both of my computers, I found out that these ligns are present in the logs of the problematic build, while they aren't in logs from the working version :


    Shader 'Standard (Specular setup)': fallback shader 'VertexLit' not found
    Shader 'Standard': fallback shader 'VertexLit' not found
    Shader 'Autodesk Interactive': fallback shader 'VertexLit' not found
    Shader 'Nature/Tree Creator Bark': dependency 'OptimizedShader' shader 'Hidden/Nature/Tree Creator Bark Optimized' not found
    Shader 'Nature/Tree Creator Leaves': dependency 'OptimizedShader' shader 'Hidden/Nature/Tree Creator Leaves Optimized' not found
    Shader 'Nature/Tree Creator Leaves Fast': dependency 'OptimizedShader' shader 'Hidden/Nature/Tree Creator Leaves Fast Optimized' not found
    Shader 'UI/Unlit/Transparent': fallback shader 'UI/Default' not found
    WARNING: Shader Unsupported: 'UI/Unlit/Transparent' - Setting to default shader.
    Shader 'UI/Unlit/Text': fallback shader 'UI/Default Font' not found
    WARNING: Shader Unsupported: 'UI/Unlit/Text' - Setting to default shader.
    Shader 'Nature/SpeedTree': dependency 'BillboardShader' shader 'Nature/SpeedTree Billboard' not found


    What makes me think this is the cause are the ligns about the text shaders. The build started being problematic rightt after finishing my function to display the description of the items in a box of text.

    edit 3: So after messing around with the "Always Included Shaders" option in the Quality Settings, I've managed to get rid of those extra lines, but the problem still persists.

    edit 4: Using the development build option, I've been able to see where the problem comes from (which script). Apparently it's a Resources.Load<> that's not working.

    edit 5: A friend and me are experiencing with script execution order. Apparently it didn't fix anything, but we are looking for a solution.

    edit 6 : Friend just told me it might be because I have old exe PlayerPrefs in my appdata, and an item default value is an old item we deleted some time ago. Would explain why this item's name appears in the debug logs.

    edit 7: YUP, fixed! It was because the executable's PlayerPrefs weren't reset (SOMEHOW) for very long, and an old item that was deleted was set as default value.
     
    Last edited: Jun 1, 2019
    haitamchawki likes this.
  2. Malmarthur

    Malmarthur

    Joined:
    May 31, 2019
    Posts:
    4
    I don't know how to close a thread (or if it is possible). Anyway, I hope this can help someone one day.
     
  3. el127791

    el127791

    Joined:
    Feb 3, 2022
    Posts:
    1

    thanks a lot it helpt me a ton
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    Please don't necro old threads. TBH, this is what the like button is for.
     
    Kurt-Dekker likes this.