Hi,
My project is a cardgame, think of Hearthstone, Yugioh, Magic etc.
Almost all of the logic happens on the backend in different arrays. The visual parts on the screen like the gameboard, the deck of cards and the players hands (cards in hand) are intended to exist only for visualisation and Player input.
Now, Im struggling with displaying and updating the cards in the hand of the player.
Originally all the handcards were inside a single object as different animation frames. It worked roughly like this: When the player draws a card, I would just spawn a new Handcard object and set the animation frame to the corresponding ID of the Playerhand Array. And this worked fine for me.
However, to reduce image memory use I would like to change my approach and instead of having all cards as frames of one single object I wanted to put them in a family, so I just have to load the cards that are actually in use at the moment.
My problem is, I cant figure out how to properly pick or create my objects using the family, to edit their variables (like their position on the screen or to which handslot they belong etc.).
The family is called "Handcard" and the different cards are objects named after an arbitrary ID I gave them like C001 or C017.
If I use the create object action to create a "Handcard" (the family), I cant control which card is created it seems to be random. At least I couldnt figure out how to specify which objetc from the family should be created.
And then I tried to create the object by name but then I cant pick the object (at least I dont know how). "Pick last created Handcard" doesnt seem to work, I guess because I didnt create the object specificly as a "Handcard".
The last Idea I had was to go through them one by one bye IID but Families dont have a overarching IID, instead the objects have unique IID's so this didnt work either.
I hope I managed to describe my Issu clearly, if something isnt clear please ask.
Thanks for reading and I really hope someone can help me. Thank you in advance!