You can't use card.get_node("Sword")
before you've added the card to the scene tree.
First, you've made card
an instance of the CardDB scene (which contains several nodes). These nodes must be added to the tree if you want to access them.
The next problem is, you're trying to use add_child()
on one of the subnodes of card
.
Presumably, you have a number of cards as children of CardDB. Try this: add CardDB to the tree and then use show()
and hide()
to show the particular card you want.
It's hard to give you any more specific advice without knowing more about your setup. I would recommend reviewing this doc which covers the basics of instancing scenes.
PS - please format your code by placing four spaces in front of it when you post a question, so that it appears
get_node("Like this")
and the underscores and indentation aren't stripped away.