-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
ObjectDisposedException on many internal nodes after reloading a scene #71032
Comments
By looking at the Godot output I also have the following errors:
|
This is the error that I get after starting the game and losing a second time:
Here's what I think is happening:
In this case, this would be a duplicate of this issue: As a workaround you can try connecting to signals with the gameEvents.Connect(GameEvents.SignalName.PlayerDied, Callable.From(onPlayerDied));
// or
gameEvents.Connect(GameEvents.SignalName.PlayerDied, new Callable(this, MethodName.onPlayerDied)); The errors about reading the C# script files look similar to what I'm getting:
It looks like it may be this issue: But it's weird because it's complaining about C# files that are engine code, not the game code. Your errors also seem to be complaining about generated code, I didn't get those and as far as I know we are generating code using UTF-8 encoding. You may find it helpful to enable keeping generated files to look into them and see if you find anything weird: <PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
</PropertyGroup> |
For the first part, I think this is definitely the same issue which was reported in #70414 I tried converting the calls using
I tried adding the property but where should the files be generated? |
The error complains about the signal It sounds like you may be using string literals for the signal name, I'd recommend using the exposed
Oh yeah, I should've mentioned, sorry about that. They are generated to |
I slightly changed the architecture of the project so that references to disposed object are not called anymore and the issue is gone. I still have to try to convert the provided project to using As for the generated files issue, after fixing the one of the disposed object it doesn't seems to happen anymore; I gave a look to the generated files and they doesn't seem to present any strange character. |
Video 13 in series https://www.youtube.com/playlist?list=PL9FzW-m48fn09w6j8NowI_pSBVcsb3V78 Was getting errors after restarting after death and couldn't figure it out. I realized thanks to this post: godotengine/godot#71032 that I was not removing the event! Removed it at the scene unloading and it worked!
Godot version
4.0-beta10.mono
System information
Windows 11, Ryzen 3700U Vega 10 iGPU
Issue description
After reloading a scene, a lot of errors come up when trying to interact with internal nodes of a scene. This happens also if:
Steps to reproduce
The provided project has a scene with a timer; that scene is istantiated as a node inside another scene (Game.tscn). When Game.tscn gets reloaded if the internal scene tries to access the timer node the exception comes out.
Minimal reproduction project
To reproduce the issue:
flappy-bird.zip
The text was updated successfully, but these errors were encountered: