Warning code line (SOLVED)

Is there a way to see which line of code produced an error like this?

WARNING:GAMEOBJECT: go.delete() invoked with nil and self will be deleted

If not, is this something that could be added, or are these errors unaware of context?

You should be able to use “monkey patching” (i.e. wrap the old function with your own) to override a function, to be able to do diagnostics/debugging.

Here’s some untested code:

local old_fn = go.delete
go.delete = function (id, recursive)
    print(debug.traceback())
    old_fn(id, recursive)
end
4 Likes

Wow, that’s really useful. Thanks!

1 Like