3D Objects disappear when running the build
This seems to be a recurrent problem, but not one with a clear and unique cause. I've checked other answers and I couldn't apply their solutions to my case.
What's happening is simple: during development, testing is fine and everything is on show, as you can see in this screenshot:
But then I generate the builds with this one scene in it, and all that I get is the UI(created with Canvas)
And this has also been observed in all build versions: Mac, Windows and Linux. I'm not even suer if input or scripts are working, an I can't find any sort of log where an exception or error could be displayed. What could be happening? Is there any way I can diagnose this?
UPDATE: Long time since I revisited this, and I managed to go further a little bit in investigation(no solution yet, though). For one, making a Development Build makes the game run. It gets better.
I found Unity's Player logs and after some time found a good lot of null pointer exceptions. Poking and prodding I managed to narrow it down to a point in the player's Update code that was supposed to place the camera always a the player's head. The camera, it seems, starts as null and then is never instantiated... in final build. In dev build, the camera is instantiated after just one error message.
I also can't walk "around" the code with null checks or exceptions. The main camera(tagged with MainCamera, as the recent versions of Unity require) just doesn't exist in the final build.
And now I'm confused. I'll come back with code and more details, but for now... that was just odd.
Your answer
Follow this Question
Related Questions
Invisible object that still receives shadows 0 Answers
Exporting custom render passes 1 Answer
Rendering issue: blue fragments on object edges 0 Answers
builded game not rendering trees from really close distance 0 Answers
Is it possible to see a render texture through another render texture? 1 Answer