This does not trigger debugger even when monodevelop is attached.
I can debug functions that originate from within OnDrawGizmos, though, and can successfully set breakpoints on certain lines of code. But not all of them (the way it used to work).
How do I fix this?
—Additional info–
I’m starting to suspect that editor compiles scripts in release mode with debugging information disabled. If that’s the case, I’d like to revert to the old behavior. How do I do it?
Well, if I pause debugger, I can set up breakpoings, but only on some lines (on a very small percentage of lines). For example breakpoint on line with initial initialization assignment will probably fall through (even if it assign result of a function call), but it might be possible to set up a breakpoint on some of my function calls.
Normally this kind of things happen (in C++ code, anyway), when compiler optimizations are enabled, and compiler starts optimizing things away. Meaning you see the line of code, but it is either collapsed or completely removed in the actual exe, so you can’t put a breakpoint on it.
Basically, when I setup breakpoints in monodevelop, everything looks fine, but when I attach to editor, they all get that “breakpoint with a hole in it” appearacne meaning they are not functioning (all of them). If I “pause” debugging (which will interrupt code execution), and start manually re-setting breakpoints (meaning remove and set them up again), then some breakpoints will set and work, but that’ll be a minority of them…
I ran into this issue on a nearly blank project with a single monobehavior. Basically, this was a quick test I made to experiment with something.
Thanks for the information. Although it is a pretty simple case, I would like a repro project. These debugger/breakpoint issues can be very sensitive to the specific IL code involved, so I want to be sure we can see the same thing you are seeing. Please submit a bug report with this project. Thanks!
I’ll most likely will be downgrading meanwhile. As hilarious as it may sound, apparently Monodevelop seem to be the best option for unity code editing. VisualStudio has formatting bug that affects C# and greatly annoys me, and VS Code’s omnisharp seems to be intent on spamming hundreds of useless “warnings” without any fix for them.
I don’t suppose there is any news on this? I’m having the same problem (initially after upgrading from 5.3.5p8 to 5.5.0f3, and also on 5.5.0p4 and 5.5.1f1).
QA told me that problem does not exist in 5.6. Which appears to be true. I suggest to roll back to 5.4 till 5.6 is released as non-beta (which should happent in March). I’m currently using 5.4.3 myself.
Of course if Unity hotfixed this issue, that would be grand.