CardScene.Instantiate() as Card;
and
new Card()
What is the difference between them?
Why do I encounter the error of node not being found when using 'newCard()'
Does anyone know? Please answer me, thank you
The difference between Instant and New
- Edited
- Best Answerset by JiuMengD
https://docs.godotengine.org/en/stable/classes/class_packedscene.html#class-packedscene-method-instantiate
https://docs.godotengine.org/en/stable/classes/class_gdscript.html#class-gdscript-method-new
This would imply you're searching the SceneTree for the instanced node - you must add it to the tree for it to exist in the tree, e.g. by calling add_child
on an existing node (where the engine will then call _ready
).
spaceyjase thank you