Start game scene with *Node* or *Node2D* for 2D Scene hierarchy setup?

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

Hello everyone!

Question: What is the difference between considering to choose Node or Node2D for setting up your 2D scene? (we are talking about scene that will contain everything else)

Is there a fundamental difference why you should choose one vs another? Is there any performance considerations? Method access?

I have seen some tutorials start scene with Node others with Node2D. Initially I thought if you go with Node2D you will not be able to child say Timer Node as it is not under Node2D but it linked without any trouble.

Thank you for any insight!

:bust_in_silhouette: Reply From: kidscancode

In most of the examples you’re talking about, it makes no difference at all.

If it’s just going to be a container to hold a bunch of other nodes, and it won’t be actually doing much of anything, then Node is fine. If you use a Node2D but it never moves, then it isn’t really affecting its children’s transforms.

The general rule is, you should start your scene with the type that provides the functionality you need.

Thank you for taking time to answer me! :heart:

Neyka | 2021-06-26 23:31