- Home /
Scene overlapping on real device
I have a 2D game where I use the following code on my Start button in my Menu scene and for the Restart button once my player dies in the Game scene. The problem is occurring only when I play the game on my real device with the Build & Run Unity setting. I have two buttons that move my player, after pressing them a few times the movement would lag and the Menu scene would overlap over my Game scene while playing. It occurs every time the game starts. More directly put. I am playing and suddenly a black background and two big START and SETTINGS buttons flash during my playing and lag my controls and then they go away. Does anyone have ideas where this issue might arise from?
public void LoadScene(string sceneName)
{
SceneManager.LoadScene(sceneName);
}
Answer by HenryStrattonFW · Feb 18, 2018 at 09:08 AM
By default the scene loading mode is Single so if you're seeing flashing then it suggests to me that one of two things are happening.
Your UI elements are somehow set to not be destroyed on load, persisting them over the scene load.
Your code is calling LoadScene constantly, causing you to flickback and forth between menu and game. You could check this by adding a Debug.Log to the LoadScene function and then keep an eye on your console whilst reproducing the bug.
To have any more of an Idea we would need to see the code that calls LoadScene as the load itself is not enough to go on.
Your answer
Follow this Question
Related Questions
Tracing Letters in Unity2D 0 Answers
Having trouble with Position X location on objects 0 Answers
Unity 3D Scene loading Issue in iOS Build 2 Answers
Build Unity iOS project in jenkins 0 Answers