Help with card instancing

Godot Version

Godot Engine v4.6.2 Stable

Question

So, I’m making a playing card game, I know I’m truly breaking new ground etc etc. Anyways, I am running into two problems right now with the game:

  1. In my test game, I’m unable to get cards to be treated as separate entities during game instantiation. Down the road I would like to have the cards all be instantiated from my “Deck” class, but right now I just have two explicit instances in my scene tree that refuse to take different face values.

As you can hopefully see from this screenshot, I should have two cards, the 3 of spades (“spds3”) and the 4 of diamonds (“dmnd4”). However, this problem persists and even if I change the values in the _ready() function.

Here is the function for my “Card” class, I hope this makes a modicum of sense.

  1. When stacked in piles, I can’t get the top card in my card pile to overlap below cards. I don’t know why, I’ve tried messing with the z-index and that wouldn’t do anything. Generally in single person card games such as Solitaire/Patience, by default you shouldn’t be able to.

It doesn’t make that much sense as still images, but basically that green pile sprite shouldn’t be visible, and it is because when I tried to drag the top card to the above pile I instead grabbed the card at the bottom.

Thank you to anyone who responds!

Are you using resources which are shared? Looks like you are using an atlas texture for the cards, but resources are shared between scenes when you dont make “local_to_scene” = true, this means changing one card changes all cards

This fixed the first problem! Thank you so much!!