Suggested scene hierachy order?

Godot Version

4.3.dev3

Question

I find this code order suggestions from the GDScript style guide¶ very helpful for structuring my scripts.

Is there a suggested order of node types for the scene hierarchies as well? Something like…

  1. CanvasLayer
  2. Control
  3. AnimationMixer
  4. Timer
  5. AudioStreamPlayer
  6. Node2D

and so on?

I honestly don’t think there is a preferred order for the nodes. Make it as logical as you need it to be.

In large parts the scene tree depends on the tasks you want to achieve. So there can’t be a general one size fits it all solution.

On a small scale some combinations make sense, like for example that a SubViewportContainer shoud always contain a SubViewport. In cases like this you will get a notification in the editor, that explains the reason for these situation.

Have you read Scene organization — Godot Engine (stable) documentation in English