Circular dependency but with one scene?

Godot Version

4.6.2

Question

Ok so I’ve gotten the load failed due to missing dependencies on two of my scenes. but the missing dependency is the same thing between both of them, so one scenes missing dependency is itself?? I’m mostly confused on why it is missing itself. the boss thing is the only dependency for both. Also neither of them will allow the open anyway option. Here’s a screenshot for clarity:

Also the code may look a bit rough right now cuz I was going through and deleting a lot to try to see if it would help.(ALSO I was following a tutorial but also trying to integrate two different sets of physics so a couple things changed but the link i was using is this: https://youtu.be/zh5bwenMn9o?si=xyAywGlnduiWCmrx)

class_name Boss

@onready var animated_sprite = $AnimatedSprite2D

var direction : Vector2

func _ready():
	set_physics_process(false)
	
func _process(_delta):
	if direction.x < 0:
		animated_sprite.flip_h = true
	else:
		animated_sprite.flip_h = false
		
func _physics_process(delta):
	velocity = direction.normalized() * 40
	move_and_collide(velocity * delta)

Looks like there’s a drop-down arrow you can expand to see what dependencies are missing. Did you try clicking that?


ok so this is what shows up

Ok, so are you referencing the boss in the boss scene? Are you adding it to an @exported variable or something?

I dont think so? the code above is all the script I have for the boss.

It looks like the problem isn’t that it doesn’t exist, but that it’s busy. Have you tried saving all the files and reloading the project?

yes, it doesn’t work.

Maybe someone else will have an idea.

If you can create a GitHub repository and upload your project folder and I can take a look at it.

not sure if it’s perfect, but I managed to get all the files in I think

Looks like multiple files have their names swapped? boss.gd should be an .import file, boss.gd.uid should be boss.gd, and so on.

Are your local files identical to those on GitHub or did just something go wrong when you shared them?

2 Likes

It looks like your boss.tscn (named brick.png on GitHub) is a duplicate of stage1.tscn. And this scene contains an instance of boss.tscn, which causes your error.

1 Like

I think something had to have gone wrong because when I checked the code for brick.png on my project everything was normal.

Open boss.tscn and stage1.tscn with some text editor. I assume they are mostly identical?

1 Like

yes they are, just slightly different ordering I think


Yeah, it looks like the boss scene got overwritten with the stage1 scene somehow. I’m afraid, you’ll have to manually remake the boss scene, if you don’t have a working backup.

1 Like

so if I delete the boss.tscn, then the scene1 should work?

Yes, in that case you should be able to “open anyway” the stage1 scene.

1 Like

Oh my god it worked thank you so much you’re a lifesaver