+1 vote

Per this discussion between reduz and Zylann:

https://github.com/godotengine/godot/issues/5983

It should be possible to debug tool scripts running in the editor.

This provides an example of debugging a scene running outside the editor with the -d flag:

https://docs.godotengine.org/en/3.1/getting_started/editor/command_line_tutorial.html#debugging

However, it doesn't stop to allow the addition of breakpoints before the scene starts executing.

We can start the editor editing the scene like this:

godot -d -e my.tscn

However, that also loads the editor immediately without stopping to allow breakpoint entry and does not recognize any breakpoints set on scripts in the editor visually, which are lost when the editor closes.

in Engine by (66 points)

I'm curious myself how to even do this. I guess it exists buried in the source code but having it documented would be nice.

I have found that if you put an assert(false) in the code, the command line debugger will stop there and you can continue from there. However, it seems buggy as the debugger than starts stopping at breakpoints that you have not created either with the command line debugger or in the editor itself.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.