Search Unity

Can I find the current execution point in code?

Discussion in 'Editor & General Support' started by DavidBVal, Oct 6, 2020.

  1. DavidBVal

    DavidBVal

    Joined:
    Mar 13, 2017
    Posts:
    206
    My code has a bug that is particularly hard to track because it happens rarely, and basically locks my UI, probably two objects calling each other reciprocally but I am unsure. It doesn't really freeze the editor, I can still hit pause or stop.

    Is there a way for me to, after pausing in editor, somehow getting a stacktrace of the current execution of the game? Sounds like something Unity should be able to produce.
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,908
    If you are still able to interact with the play/pause button, such a stack trace would probably not help you, because the game loop is still running and therefore the trace may happen at essentially any random point in the loop.

    When you say it locks your UI do you mean your in-game UI or the editor UI?
     
    Joe-Censored likes this.