Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more..
    Dismiss Notice
  3. Dismiss Notice

Resolved Build broke my scene? HELP APPRECIATED

Discussion in 'Editor & General Support' started by Henzig, May 28, 2021.

  1. Henzig

    Henzig

    Joined:
    Aug 18, 2020
    Posts:
    22
    Hi,

    So. I have a three scene project that I've been working on for some time without any hitches. Yesterday I made a build (the first one) using default settings to OSX. Afterwards my main scene looks like this in the editor (see image 1). The other two scenes render fine in the editor window (and game view).

    Good to know:
    - Gizmos are visible (image 2) when objects are selected.
    - I upgraded the project to use URP somewhere midway a month ago or so. It wen't very smoothly.
    - I'm running 2020.3.2f1 LT.
    - Console reports no errors.
    - Curiously I can run my game. But only UI elements renders in game view! Sounds and input works.
    - Note that the selected prefab (a textured mesh) doesn't render in the inspector preview window either...

    I am at a loss and a little sad that I'm having a "zero-day". :)

    Any suggestions is greatly appreciated. I have no experience with builds. Do I have to prepare a build somehow or does it change anything within the scene that I should be aware of?

    Thanks.

    Skärmavbild 2021-05-28 kl. 21.37.40.png
    Skärmavbild 2021-05-28 kl. 21.40.56.png
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,769
    I'm sorry you've had this issue. Please consider using source control in order to guard and protect your hard-earned work.

    Personally I use git because it is free and there are tons of tutorials out there to help you set it up.

    As far as configuring Unity to play nice with git, keep this in mind:

    https://forum.unity.com/threads/prefab-links-keep-getting-dumped-on-git-pull.646600/#post-7142306

    Here's how I use git in one of my games, Jetpack Kurt:

    https://forum.unity.com/threads/2-steps-backwards.965048/#post-6282497

    Using fine-grained source control as you work to refine your engineering:

    https://forum.unity.com/threads/whe...grammer-example-in-text.1048739/#post-6783740

    Share/Sharing source code between projects:

    https://forum.unity.com/threads/your-techniques-to-share-code-between-projects.575959/#post-3835837

    Setting up the right .gitignore file:

    https://forum.unity.com/threads/removing-il2cpp_cache-from-project.1084607/#post-6997067

    ONCE YOUR PROJECT IS SAFE AND IN SOURCE CONTROL... now you can experiment.

    Reimport all, then build. Does it work?

    Make a single scene with a cube and build it. Does it work?

    Add that cube to your non-working scene in the build. Do you see it?

    etc etc etc

    ALWAYS USE SOURCE CONTROL!!!
     
  3. Henzig

    Henzig

    Joined:
    Aug 18, 2020
    Posts:
    22
    Hi Kurt,

    Yes. When this is fixed I’ll most definitely have to get that up and running.

    Any suggestion on a fix for the issue at hand?
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,769
    Did you read this? How did it go:

     
  5. Henzig

    Henzig

    Joined:
    Aug 18, 2020
    Posts:
    22
    Oh dangit.

    I can create an object in the broken scene but it won’t show. Works fine in the other scenes. It’s like Unity lost it’s lighting and mesh rendering capabilities in this one scene.

    I don’t have access to my computer right now. I’ll will specifically move a working object from one scene to the other in the morning. Perhaps duplicating everything into a new scene (as suggested) could be a fix.

    I’ll make sure to get back to you. Thanks!
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,769
    Make a new scene, open both, drag everything from the old to the new, don't save the old, just add the new and try it.
     
  7. Henzig

    Henzig

    Joined:
    Aug 18, 2020
    Posts:
    22
    Alright I got to try it. Doesn't solve it I'm afraid.

    However. It did produce a series of console errors.
    Skärmavbild 2021-05-29 kl. 10.46.53.png

    The second to last line references "CreateGlobalLight2DValidation". In total there are 10 different console errors and the only variation is the type of 2D-light referenced in this line.

    In short this might have showed the path... Is URP broken? To be clear - no 2D objects (or lights) are being used in the project. Save for UI elements of course.

    Thanks again.
     
  8. Henzig

    Henzig

    Joined:
    Aug 18, 2020
    Posts:
    22
    @Kurt-Dekker

    I found it!
    Making a build for some reason emptied the slot "renderer-list" in my URP-asset. Re-assigning it made everything pop back into existence.

    Thank you so much for lending a hand. I'll be spending the rest of my time today to set up version control. :)
     
    Last edited: May 29, 2021
    Kurt-Dekker likes this.