Preferred node design. Should StaticBody2D be a child of Sprite2D or vice versa

Godot Version

v4.2.1.stable.official [b09f793f5]

Question

Just curious about node design. Is it better making Sprite2D the child of StaticBody2D or vice versa. Seems either way works fine. In the screen shot below I have both. What is the preferred way of doing this? Is there a design document regarding this?

Because StaticBody* instances do not move, there is no difference.
If you were using RigidBody* you’d probably want the sprite inside if you want it to move based on the physics, or outside otherwise.

1 Like

Ah now makes sense. I have also a Player CharacterBody* and Sprite is inside. Feels more natural.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.