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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

VS Community debugging - break out of infinite loops

Discussion in 'Scripting' started by guitarxe, Nov 28, 2015.

  1. guitarxe

    guitarxe

    Joined:
    Dec 1, 2013
    Posts:
    131
    Trying to debug an infinite loop and it doesn't help that Unity will happily keep looping till kingdom come instead of timing out at some point, so I have to keep killing Unity and restarting it to keep debugging.

    Is there a way to force stop script execution from VS Community while you are debugging? Unity is inaccessible while script is paused in debugger, and if I stop debugging it simply detaches and Unity keeps on hanging.
     
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
  3. eisenpony

    eisenpony

    Joined:
    May 8, 2015
    Posts:
    971
    Not sure about VS community but in other flavors I've used, there is a "break all" button. It basically causes all threads to immediately hit a break point. It may not break exactly in your loop but the stack trace might be able to point you in the right direction so you can place a regular break point.
     
  4. Will-H

    Will-H

    Joined:
    Dec 12, 2013
    Posts:
    8