Can I find the current execution point in code?

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.

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?

1 Like