+1 vote

I just got finished with my text based game in Godot 3.1.1 however I've run into an issue that causes the game to crash when exported. I am very new to game development so I really have no clue how to fix it.

Here's the problem. I have many yield coroutines within functions to act as a timer node without having to create a timer node. Basically a way to wait for (x) seconds before continuing to run through the program. I looks like this:

yield(get_tree().create_timer(0.2), "timeout")

I honestly don't know exactly how it works cause I just found it with a google search. It does exactly what I need it to do except it generates errors that read Resumed after yield, but class instance is gone. When expanded, it reads modules/gdscript/gdscript_function.cpp:1771 @ _signal_callback(). It seems this error comes up between 2-5 times when my scene is loaded and not when the yield is actually being executed. Also, another one of my scenes uses the exact same line of code but doesn't have this error.

Any help would be greatly appreciated and I've attached the zip file for anyone to look through. (P.S. I am aware that the code is atrocious and could be done way better. I'm new to programming so this was the way I thought of doing it and I had a deadline so syntax wasn't my highest priority.)

Thanks in advance!!! :)

https://bit.ly/37qPJUx

in Engine by (20 points)
recategorized by

This usually happens if the node that the yield is on has been freed/deleted, are you using queue_free() anywhere?

Thanks so much for the suggestion. I found out that the errors were occurring in a different scene that I thought and when it switched scenes, this error came up. I was able to swap out the yield for a Timer node since the programming for that scene wasn't too complicated. I still used the yield command in my other scene but for some reason the error doesn't pop up. I don't know why but I'm just glad the issue's gone :)

However, when I export my game, it crashes as soon as I try to open it. I thought that getting rid of all the errors would fix this but it didn't and now I have no idea what to do next :(

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.