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

Expose internal variables, such as velocity, to the debugger inspector #8091

Open
jitspoe opened this issue Oct 13, 2023 · 6 comments
Open

Comments

@jitspoe
Copy link

jitspoe commented Oct 13, 2023

Describe the project you are working on

Retro FPS

Describe the problem or limitation you are having in your project

I'm trying to debug some movement, but the debugger does not show the value of velocity in the inspector.

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

Exposing relevant values -- things like velocity that can be set in script -- to the inspector window while debugging would make things easier to debug.

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

image
Note how the velocity value can't be seen here by mousing over body.velocity nor can it be seen in the inspector.

Perhaps velocity is just an oversight, as things like the transform can be viewed and set here. Not sure if it makes sense to set velocity in the inspector, but maybe that's worth adding if it's more difficult to have a read-only view solution.

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

I suppose velocity could be stored in a temporary variable, but that's not super great if you've found a rare bug and can't update the code.

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

Core debugger feature.

@Calinou
Copy link
Member

Calinou commented Oct 13, 2023

Since Godot 4.0, the inspector is able to export properties as read-only, but I'm concerned about having this value displayed within the local editor inspector when it'll always be 0. (The only case where it won't be 0 is in the remote inspector.)

@jitspoe
Copy link
Author

jitspoe commented Oct 14, 2023

Wonder if it's worth adding the concept of remote-only read-only variables for cases like this.

@SaracenOne
Copy link
Member

I think we've got an extra two bits left in the PROPERTY_USAGE_ flags. Perhaps we should add a PROPERTY_USAGE_REMOTE_ONLY flag for stuff we want to show up in the remote inspector, but not the regular inspector.

@SaracenOne
Copy link
Member

Either that or we just make everything which doesn't have the PROPERTY_USAGE_EDITOR still show up in the remote inspector.

@jitspoe
Copy link
Author

jitspoe commented Oct 17, 2023

I'm always hesitant to add more flags when there are only a couple left. Wonder if there are any down sides to showing everything in the remote inspector. That might be the best option, as it wouldn't require a bunch of explicitly adding flags to all the properties.

@wyattbiker
Copy link

I was under impression that any property in the documentation, autocomplete or settable by the application, will show up in the inspector. Not sure why bother hiding them. In the case of velocity it is just like position.

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

4 participants