Flickering image from the previous scene

I encountered such a problem.
After moving to a new scene, a flickering image from the previous scene (menu) is shown in the letterbox areas.


I tried deleting menus gameobjects before loading a new scene,
and tried clearing the camera after loading a new scene.

    private void CameraCleaning()
    {
        _camera.clearFlags = CameraClearFlags.SolidColor;
        _camera.clearFlags = CameraClearFlags.Color;
        _camera.clearFlags = CameraClearFlags.Skybox;
        _camera.clearFlags = CameraClearFlags.Depth;
        _camera.backgroundColor = Color.black;
    }

I show an image (guns and zombies) with a black background before loading the game scene so that the previous camera image is overwritten.
None of this helps.

I tried this method before loading a new scene. Did not help.

GL.Clear(true, true, Color.black);

I tried this method in Start in a new scene. It only helped once.
After I returned to the Menu and back into the game scene, the problem returned again, although every time the in game scene Start:

GL.Clear(true, true, Color.black);

This problem only exists on iOS, so I think it’s a Unity bug.
What is the reason? How can this be solved?

Is there any way to contact Unity support? Perhaps only they can solve this problem.

p.s.
Sorry, I hid the gameplay of the game in the video because it hasn’t been released yet)

A likely solution to the problem would be to answer: “Why does the camera in the New Scene retain the image from the previous scene?”
Where this information stored to delete it?

have you tried using GL.Clear()?

your “clearing” confuses me, you’re just toggling between several camera settings

I haven’t tried this method
iknow:
GL.Clear() requires caution as it is a low-level operation and can affect the operation of other elements of the rendering system. In most cases, it is better to use the standard Unity tools to control background color and other rendering parameters through camera settings and project settings.

How to use it safely?

i haven’t personally experienced any trouble with gl.clear, but i’ve only used it in my lightmapper, which is an offline process. my best advice would be try it out and see if you experience any issues.

i’m pretty sure there’s a forum post talking about issues on an ipad, but i can’t find it right now

1 Like

At what point do you think I should use gl.clear ?
Just before loading a new scene?

either that or right when the new scene starts

1 Like

Thanks for the offer. I’ll try and write the result

1 Like

I tried this method before loading a new scene. Did not help.
GL.Clear(true, true, Color.black);

I tried this method in Start in a new scene. It only helped once.
After I returned to the Menu and back into the game scene, the problem returned again, although every time the in game scene Start:
GL.Clear(true, true, Color.black);

have you tried putting a black border to cover where this is to maybe make the camera render that instead of blank space? if you already have borders there i really have no clue what’s going on, this really isn’t something I’ve seen

Yes, I do it. Letterboxes are black lines at the top and bottom of the screen to adapt to different screens.

Is there any way to contact Unity support? Perhaps only they can solve this problem.

you can file a bug report

1 Like

I solved this problem.

1 version
When I exit the menu, I launch an empty scene in which there is a black Overlay that fills the entire screen.
After this scene, the game scene is already loaded.
This solves the problem.

2 version
It also helps if you run a black Overlay on the entire screen in the game scene and remove it after a second. This method also works, but then it needs to be done in every game scene. I chose the simpler first version for myself.

It’s very bad that not a single solution for cleaning the camera using code works.

1 Like

i’m glad you could solve it!

As it turned out, my decision was not permanent.
The problem that I wrote about repeats itself periodically