0 votes

hello I am fairly new to godot I managed to hook it up to my vscode how ever when ever I work on my game I am face with the same error in my terminal.

ERROR: Resource: 'res://Scripts/MainMenu.gd' is already being loaded. Cyclic reference?
   At: core/io/resource_loader.cpp:361

I didnt pay much attention to it till I had to implement my pause functionality and my debugger gave me this error:

E 0:00:00.602   load: Resource: 'res://Scenes/MainMenu.tscn' is already being loaded. Cyclic reference?
  <C++ Error>   Condition "!success" is true. Returned: RES()
  <C++ Source>  core/io/resource_loader.cpp:361 @ load()

any advice please

Godot version 3.2.3
in Engine by (30 points)

2 Answers

0 votes
Best answer

I fixed the problem by swapping out preload() with load() instead.

by (30 points)
0 votes

Are you preload()ing MainMenu.tscn from within MainMenu.gd?
Cyclic errors usually occur when you preload() ClassA from ClassB when ClassB already preload()s ClassA - they create a chicken and the egg problem for the script parser.

by (3,710 points)

yes I did use preload() however I managed to fix the problem by using load() instead.

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 Frequently asked questions and 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.