I am creating a game in which player have to interact with many gameobjects (Mushrooms, trees, rocks, even tufts of grass). There is no problems with rendering, because i use layerCullDistances, but there is still many gameobjects. Maybe i have to save all gameobject positions in List and instantiate them when player are near? Or is there other way to do this?
If I’m understanding your question something along the lines of object pooling could be helpful. This allows you to create lists of objects that can be actived/deactived on demand, it also has less of an impact than instantiating and destroying obejcts… link text
Instantiating objects while the user is playing is not a good idea, especially if there are alot of them. The allocation and deallocation of memory can cause hiccups while playing since the garbage collector has to kick in more frequently. A good way to avoid this problem is to use pooling, like axldoyle said. I recently wrote an blog article about that topic. Maybe this can help you finding a solution. Pooling Part 1: Optimize your game’s performance – Christian Henschel