- Home /
Objects Disappear After Building
I have absolutely no problems building, testing, editing, etc my game in the Editor. The game itself is basically a robot arena and consists of a Plane (floor), some sideways Cylinders (inner walls), Cubes (outer walls) and a few other things. When I hit the play button in the editor it works great and everything I anticipated works. When I go and build the game as a computer standalone (tested both Mac and PC) the game becomes very messed up. The Plane floor is completely gone (gone not invisible) and many objects fall down infinitely because of that. The Cylinder walls stay in place and a few other cubes stay in place too. It appears like all scripts and lights work fine. The problem seems to be that for some reason the majority of the objects in my game disappear ONLY when compiled and built as a standalone.
Does anyone know how to fix this? Thanks a Ton!
Answer by Meltdown · Aug 28, 2011 at 09:43 AM
I'd suggest changing your floor plane to a cube and making sure it has a box collider. I've often seen items fall through planes. But the fact you are getting a different result in the editor to a stand-alone build is very strange indeed.
Along with that check all of your scripts, and everything else for any errors.
Answer by Destroyd · Aug 28, 2011 at 09:11 PM
I managed to fix it. I still don't quite know why it does that or why what I did fixed it, but I'm glad it did.
For the objects that were parented, I had to reparent them (often that meant moving them out of their parent in the hierarchy, recreating the parent, then putting them back in) and for the objects that did not have a parent, I simply had to recreate them. Most objects needed to be "re-done" one way or another as said above, but some didn't and I am still confused as to why.
To anyone who comes across this issue, keep your parenting structures simple and if anything disappears upon building, recreate it and it should work fine. Duplicating it via Control-D or Command-D does not work. You must create a new object from scratch. It seems as though some objects had some kind of invisible property that made them uninstantiable when built. This would explain why duplicating them didn't fix it (the property got copied as well, but a new object didn't have this property.)
I am 99% certain it wasn't anything visible in the editor. I've checked all components the troublesome objects had and nearly all settings in each similar component. Some objects didn't have scripts, so I didn't check those thoroughly.
To the developers of Unity, you've created something incredible. Incredibly powerful, versatile, and ingenious, yet also incredibly confusing at times. You'll get it right, I know you will ;)
Answer by COLLAnitySV · May 09, 2012 at 10:13 AM
Check your game object tag. It should not be editor only
Answer by Mansoor1 · Apr 22, 2016 at 04:17 PM
OMG!!!! It really worked :D I got the same issue of invisibility of certain game objects after building n run the game. The problem was shader, the default shader that unity provide for our game objects...Just changed the shader from standard shader to legacy shader....then all of those game objects that were invisible became visible :D
Answer by giovannyofficial69 · Jun 07, 2020 at 10:06 AM
its 2020 and i still have this problem. So stressfull