Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
3  
Are you sure the curly braces under the if are placed correctly? – Alexandre Vaillancourt 11 mins ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.