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

Exported variables don't update in Inspector when debugging #63

Open
WinstonHartnett opened this issue Jul 17, 2020 · 3 comments
Open

Comments

@WinstonHartnett
Copy link

Exported variables in GDScript are updated in real-time in the Inspector when debugging Remote. Is this possible with GDNative/godot-nim? I've tried calling the propertyListChangedNotify method of Object, which this godot-engine issue refers to, but it seems to do nothing.

@WinstonHartnett
Copy link
Author

WinstonHartnett commented Jul 17, 2020

And... nevermind. After getting real-time property updating in godot-rust and godot-mono working flawlessly, it couldn't be a GDNative problem.

It seems godot-nim doesn't update Remote Inspector properties if the debug window isn't focused? Is this a bug?

If Godot is in the foreground, Inspector values do not update even when the game loop continues just fine. This behavior is unique to godot-nim from what I've tested. I am on Arch Linux but will test on Windows tomorrow.

@endragor
Copy link
Member

Exported properties ({.gdExport.}) of godot-nim objects should behave like any other properties from Godot's perspective. If Godot updates them, they will be updated. If Godot requests a list of properties, they will be in that list. Is there an example where your issue could be reproduced?

@WinstonHartnett
Copy link
Author

Just tested the same projects on Windows, the values do update even when the window isn't focused. This must be a Linux + GDNative bug (as Mono and GDScript work as expected on Linux). Also, I must have been mistaken, because godot-rust now shows the same odd behavior.

It can be reproduced on Linux by cloning the godot-nim-stub repo, adding a Node2D under Panel with the following Nim class:

test.nim

import godot
import godotapi / [node_2d]

gdobj Test of Node2D:
    var
        testVar* {.gdExport.}: float = 1.0

    method ready*() =
        print "Readied!"

    method process(delta: float64) =
        if self.testVar > 1000.0:
            self.testVar = 0.0
        else:
            self.testVar += 1.0

        print self.testVar

Run the debug, go to Remote and watch test_var in the Inspector update only when the game is focused.

Here's a gif demonstrating what it looks like.

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

No branches or pull requests

2 participants