Unity Restart Scene Glitches Help
Hello i just created a endless runner everything works fine on unity , when i play on IOS and Android , when i press restart button from canvas after 3-4 times when restart was pressed game start to glitch , backgrounds starts to move slower , player start to move slower, and game starts glitching please help out.
MenuControllerScript.cs:
public void RestartGame() { if (GameStateManager.GameState == GameState.Dead) RequestBanner(); { GameStateManager.GameState = GameState.Intro; SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); } }
Sorry for bad english
sounds to me that you have Dontdestroyonload gameobjects that stay and eat performance. check the profiler and hierarchy in the editor and what it does after 2, 5, 10 restarts, maybe something is piling up. your code is ok.
Your answer