Question by
imranomb · Dec 25, 2021 at 11:01 PM ·
optimizationscriptableobjectgarbage-collection
Optimization problem (Garbage collection=
Hi, I'm making a card game, and I'm making each card as a scriptable object, and each of those objects contains data, 2 sprites, 1 string, and a few variables. One of the game systems is pack opening, it is necessary that every time a player opens a pack to get a different card. I managed to make this system by making a list and adding all these scriptable objects to it, about 100 of them. But I have a problem with garbage collection, because every time I start a scene or when a player opens the pack it increases and FPS decreases. I'm wondering if anyone knows how to optimize this, or some other way to make this system more optimized.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613050930im_/https://answers.unity.com/themes/thub/images/avi.jpg)