Instancing classes in the scene tree and node type?

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

When you instance a class using .new() what is the default location of the node in the scene tree and if it is a script registered as a class with no defined node type in the script what is the default node type it is instanced as?

:bust_in_silhouette: Reply From: Wakatta

Firstly instance() and new() are not the same things

Think of an instance as a predefined node / scene that you’re making a copy of well its not really a copy hmm analogy time…its like a woman making a baby, she obviously uses some blueprints and not creating that thot from scratch

Speaking of Scratch that’s whatnew() does and there is no location in the sceneTree until you add it using add_child(new_node) and it’s location is dependent on the node that adds it which becomes its parent (see didn’t just randomly talk about mothers)

a class with no defined node type

Ends up as a Reference an is one of the building blocks of all Objects, which in turn is actually the very base