Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Script pauses game

Discussion in 'Scripting' started by rainboww, Nov 27, 2018.

  1. rainboww

    rainboww

    Joined:
    Jan 5, 2017
    Posts:
    125
    Hello,
    I have a game script and when i click on turn end it sometimes just pauses the game.
    The logs tell me that end turn does finish and the player log does not report an error.

    Pauses means here that it is as if i would click on the pause button near the play button.

    What can cause this? It seems pretty random and i have no idea whats the issue.
     
  2. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
    Debug.Break() causes the pause button. Search for that
    Alternatly/additioanlly, check the console for an actual error (make sure console has all displays enabled), player pauses on errors
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    By default Unity will pause play mode if you encounter certain errors. Not sure when they added that, because that wasn't always the case. Check your console whether you are hitting an error when this occurs. There is a setting somewhere to disable that feature if that is the case (or better yet address the errors).
     
  4. rainboww

    rainboww

    Joined:
    Jan 5, 2017
    Posts:
    125
    Thankyou i found 3 occurrences and removed it. :) I will try tomorrow if it solved the problem.
    No error there, guess it was indeed Debug.Break()