Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I think you should not reload the script. make a function that redistributes the cards and call it when the player has 0 cards. To know the number of cards...you first need a variable that records it....maybe store it in player manager script....make a singleton game manager and add this player manager as an object to it.and call the function with an if..else  under update there. I could help more if you share some screenshots of the code and your project structure

So from what I understand you have spawn points that spawn random cards from the objects array. It is not clear tho what those below 6 cards represent. So when do you call the function to spawn. And do you call a function when you play a card. Anyways, what I suggest is that make a player manager script...and do all the things like generating cards, playing cards in it...that way you can have a variable of number of cards...and change that variable whenever you play a card or draw cards.