0 votes

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?

Godot version 3.2.3
in Engine by (25 points)

1 Answer

0 votes
Best answer

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

by (4,168 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.