I am working on a mobile game in which levels are procedurally generated. Now I have come to a point where I can spawn trees and rocks etc randomly. I need to declare those objects as static so I use this code-
GameObject g=Instantiate(prefab, position, rotation);
g.isStatic=true;
This documentation says that setting isStatic at runtime has no effect.
So is there any way to generate the world before actually loading the runtime scene so that static property would work?