Z ordering not working and parenting removed on build...

So I’m working on the lowrez game jam and tried to make a build for my music guy to play a bit so he can start trying to make music. Works completely fine in the editor, but as soon as it builds, it goes completely insane.

Here’s a video example of what’s wrong.

I’ve tried updating from the 2020.1.0f1 that I had to 2020.1.1f1, changing the color space from gamma to linear, changing the render path, changing to webgl instead of windows build, etc.

It’s weirdest most cause it’s not just the sort order, but parenting on things that aren’t animated are not parented after the build. (Note the UI as well as the ghost like guy’s shadow)

Any help would be appreciated as this makes my game not work, and would not be valid for submitting to the jam in a weeks time.

So I’ve tried changing a ton of settings, downgrading to different versions of unity (down to 2018’s LTS release) and it’s still doing the same thing. I tried opening a different but similar project from before and building it, and it has no problems with the same versions of unity. I’ve also tried deleting everything except the assets folder to start from scratch and it’s the same as in the video. At this point I can only assume something is up with the prefab files to where it works in the editor due to the scene loading them right, but somehow there is a disassociation of who’s the parent when built some how.

Anyone have any other ideas? I’m going to try just rebuilding (like make a new gameobject, attach the scripts, animations, etc) things like the player and the enemies tomorrow when I have time. @_@ This has really put a damper on things and when I’m already limited on time, the 8+ Hours I’ve put in to installing different versions of unity and building and rebuilding the project, I’m really at a loss.

It should be working. I haven’t found any flaws in 2d sprites.

I assume player and other items are 2d sprites on same sorting layer. Video does not show the order in layer of the sprites (in inspector). Check sorting layer and specially Order in Layer. Described behavior often happens if all are have same order number.

Use big number for player, middle number for enemies, small for props, and smallest for background. For example: 100 for player is keeping him top (value for Order in Layer).
6224805--684678--upload_2020-8-20_9-14-6.png