"Cyclic" dependency rules?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Shikadi

Say I’ve got class A, B and C

B depends on C
A depends on B & C

I’m auto-loading C, B and A in that order.

Godot appears to see this as a cyclic dependency. Why/what’s the fix?

:bust_in_silhouette: Reply From: the_maven

You should avoid that kind of behavoiur in your code.
In Godot no node should be dependant of other nodes. It’s that way by design.

Let’s pretend you want to make a car but each of its pieces you decide will be a single node: tyres, doors, etc… So that way you can edit each node by each own.

All those nodes will be instanced in a single scene: Car.
That scene, Car, will have all those nodes combined to make a car but each will not have dependancy of the others. The Car scene will combine those nodes together to create a car.