What I need is to destroy the leftmost card and add it back into the pool, and the pool should always contain only 5 cards per color. However, what happens is that the count for the leftmost color always increases to 6, and when a new card comes in, the old one then shows as 5. I don’t know how to fix this. Could you please help me?
#I have an issue related to destroying and recreating.
2 messages · Page 1 of 1 (latest)
If you set up your pool correctly, with Spawn / Unspawn handlers, you don't call ReturnCard here...
NetworkServer.Destroy(leftmost.gameObject); // remove card
CardPoolManager.ReturnCard(leftmost.gameObject); // +1 pool
Your Unspawn handler should already be doing that.