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

Scene keeps having its root class's script removed when project is loaded #78211

Open
Tracked by #80877
blackears opened this issue Jun 14, 2023 · 3 comments
Open
Tracked by #80877

Comments

@blackears
Copy link

Godot version

v4.0.3.stable.official [5222a99]

System information

Windows 10, Compatability

Issue description

I've been working on a solitaire game and my project has developed an issue. The scene card_body.tscn needs to have it's root node have the card_body.gd script attached to it. However, the project has developed some sort of an issue where this script keeps being removed form the editor.

Steps to reproduce

If I open the project, and open res://scene/card_body.tscn, the root node will have no script attached. I then click on the attach script button and attach card_body.gd. The project now works. However, if I save the project, exit and reload, card_body.tscn no longer has the script attached and I have to manually reattach it.

Minimal reproduction project

Solitaire.zip

@Zireael07
Copy link
Contributor

Do you have cyclic dependencies in the project?

@blackears
Copy link
Author

blackears commented Jun 14, 2023

None of my scripts are cyclicly dependent. Not sure if there is something more obscure that may be.

@heppocogne
Copy link
Contributor

Not only preload(), typed GDScript can cause cyclic dependencies. for example:

class_name ClassA
var b:ClassB
class_name ClassB
var a:ClassA

And this may be related to #76641.

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