Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global_position and immediate/watch data not part of debug #1979

Open
chucklepie opened this issue Dec 12, 2020 · 3 comments
Open

global_position and immediate/watch data not part of debug #1979

chucklepie opened this issue Dec 12, 2020 · 3 comments

Comments

@chucklepie
Copy link

chucklepie commented Dec 12, 2020

Describe the problem or limitation you are having in your project

When in debug, there is no means of finding out a node's global position. Local position is of no use when you want to check a position relative to another node's position.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Simply provide a means of getting at global_position, and probably many other data variables that Godot does not provide.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Either simply add global_position to either the breakpoint list or the Inspector list. Or even allow hovering over 'global_position' would be enough for most people...

To make it wider, I'm sure somebody must have suggested having something pretty much built into every debugger, an 'immediate window' or a 'watch' window, i.e. part of the editor that allows either variables to be added for viewing or even typed to be evaluated (given this is a scripted language it should be easy enough to parse and display 'out of scope' or the value.

The list is pretty much endless for missing information, for example trying to find a resource's value such as visibility or collision box extents and (don't quote me!) the data showed for these items are the design time not runtime values for a lot of nodes.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No. In my case, the only way I can find is to temporarily add a variable, because for some reason the editor doesn't even want to show global_position when you hover over the variable - so double whammy there ;)

Is there a reason why this should be core and not an add-on in the asset library?

Basic debugging options and ability to view a core data item

@Calinou
Copy link
Member

Calinou commented Dec 12, 2020

I'm sure somebody must have suggested having something pretty much built into every debugger, an 'immediate window' or a 'watch' window

See #1074.

@chucklepie
Copy link
Author

chucklepie commented Dec 12, 2020

thanks, I find it hard to believe such a useful feature was implemented but never merged and then somebody wanted to close the issue :)

but back on the original question, why is global_position not in the debug window and why can't you even hover over it in the editor? and why can you not actually see resource data such as collision shape extents (if they're modified in code they don't appear in the editor, only the original making it completely confusing and impossible to debug)

Thanks. Is this request sufficiently different as I'm asking for more data to be made available to the debugger not necessarily a full blown ide update...

@Calinou
Copy link
Member

Calinou commented Oct 10, 2021

but back on the original question, why is global_position not in the debug window and why can't you even hover over it in the editor? and why can you not actually see resource data such as collision shape extents (if they're modified in code they don't appear in the editor, only the original making it completely confusing and impossible to debug)

This is likely because the Node2D global_* properties are not stored or serialized over the network, as referred by their usage set to 0:

https://github.com/godotengine/godot/blob/512211b61c82ec693b5b198a6238a94cdfdf953c/scene/2d/node_2d.cpp#L431-L435

Storing and serializing those properties over the network would be redundant, so this behavior shouldn't be changed in Node2D itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants