Sprites render before UI when starting game first time

Hey all!

So my game is a single scene game, the start menu is just a canvas that I disable when the game starts. The problem I am facing is that the first time I start the game on my device the 2d sprites are visible before the canvas can hide them. This makes for an annoying bug where the game setting is visible for a few milliseconds before the start menu actual is brought up. Here is a gif of what it looks like from my reddit post:
https://www.reddit.com/r/Unity3D/comments/av1x5r/hairpulling_bug_sprites_render_before_ui_when/


What I think it could be:

  1. Z-axis is wrong
  2. The order of the objects in the inspector is wrong
  3. The Layer is wrong
  4. The order in layer is wrong
  5. The render mode of the canvas is wrong

I have attached images of the settings in the inspector

This is the setting on the loading screen

This is the setting on the main camera, which seems to render its contents before the canvas

Hi,

Have a look at this documentation : Unity - Manual: Script Execution Order settings
By changing scripts execution order you should solve your problem.

regards