Over the course of my mobile game potentially hundreds of inactive objects could be generated. The game is rather physics intensive with up to 16 2d rigidbodies. I have optimized the code so it runs reasonably well on lower end phones but not with a large amount of inactive objects. Would hundreds of inactive objects affect my performance by taking up memory on a weaker phone like the iphone 4?
Bonus question, if it does take up memory I want to implement some garbage collection to delete the inactive objects. I’ve been having trouble setting up references when the objects become inactive. Any insight on how to set it up? i’ve been following this but i’m getting lots of compatiblity errors setting up the array. Cannot toggle active on gameobjects that are inactive - Unity Answers
Thanks