-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
4.4-dev6: Signals don't work in exported builds if .godot dir was created by dev6 #100097
Comments
Just looking at the dev6 changelog, a possible commit that might have caused this is #97303. (Because perhaps the "avoid duplicating signals" avoided something necessary to do with signals, and wrote that into the PackedScene inside the |
I tested the issue (on the Web platform, running dev5 and dev6 as explained) and I can confirm it. |
I can confirm too that the regression is caused by #97303. I reverted the PR from master, then created a project with it. And it works when exported. |
CC @cixil |
The problem seems to be how the godot/scene/resources/packed_scene.cpp Line 609 in aa8d9b8
Changing this to use GEN_EDIT_STATE_MAIN fixes the bug, but it's probably not the right fix.
The bug happens, because scenes are processed during export if you have editor/export/convert_text_resources_to_binary enabled, and due to wrong inheritance state, the connections are lost.
|
Well there is another case of this bug (or at least I think it is related). Signal connections don't work in scenes instantiated by plugins, like custom main screens. EDIT: EDIT2: |
Don't know if it matters, but you can get around this bug by connecting signals via code instead of the UI. |
Confirmed on android XR builds. Good to know ^_^ |
Can anyone explain exactly what the role is for this flag: Line 575 in aa8d9b8
and these enums?: godot/scene/resources/packed_scene.h Lines 126 to 131 in aa8d9b8
re @KoBeWi's comment godot/scene/resources/packed_scene.cpp Line 609 in aa8d9b8
EDIT: Ah I see this is added when instantiated scenes are added as children in the editor? I forget the same code is used in the game runtime and in the editor |
The flag is temporary. All connections that belong to a different scene than the currently opened one will get the flag once the scene is loaded; this applies to instances and inherited scenes. |
I guess a simple fix to #97303 could be to add |
The problem exists in the editor. |
Tested versions
System information
Godot v4.4.dev6 - Ubuntu 24.04.1 LTS 24.04 on X11 - X11 display driver, Multi-window, 2 monitors - OpenGL 3 (Compatibility) - NVIDIA GeForce GTX 1060 6GB (nvidia; 535.183.01) - Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz (4 threads)
Issue description
In 4.4-dev6, signals do not work, at all in exported builds. The signal handlers are never called. I have tried both built-in signals (such as clicking a button) and custom signals (calling
.emit()
).However, the circumstances are extremely weird. It is not tied to the Godot version you used to export, but rather, the Godot version that created the
.godot
directory.To elaborate:
.godot
directory, then re-open with 4.4-dev6, signals are broken..godot
dir created in dev6) in 4.4-dev5, and export, signals are still broken!So this bug can manifest in 4.4-dev5 and earlier, but only if the
.godot
dir was created by dev6.I'm at a loss to explain this behaviour, but I have tested it extensively (on Linux), both on a "real" project and in a minimal repro. I have compared the "good" and "bad"
.godot
directories and can't see much that would distinguish them - the binary.scn
files are different but you would expect those to regenerate every time you re-save the scene. And shader cache files are different, but you wouldn't expect that to affect something as unrelated as signals.And to be clear, everything works fine in the editor. It's only broken for exported builds.
I have tested both the Linux native and Web exports, and the issue affects both.
Steps to reproduce
pressed()
signal up to a new method.print('Button pressed')
to the signal handler. For good measure, also$Button.text = 'Pressed'
.New Game Project.x86_64
.As mentioned above, there are some very weird interactions if we change Godot versions:
.godot
dir and re-open in dev5 - it now works..godot
dir and re-open in dev6 - it is now broken again.Minimal reproduction project (MRP)
signal-repro.zip
The text was updated successfully, but these errors were encountered: