Hi.
I have some prefab objects. When I start the game I instantiate some prefabs. In the code I set the static check box of the prefabs.
Why?
Now, I’m programming for mobile now. And I think, maybe I get some performance on old devices.
Hi.
I have some prefab objects. When I start the game I instantiate some prefabs. In the code I set the static check box of the prefabs.
Why?
Now, I’m programming for mobile now. And I think, maybe I get some performance on old devices.
Static should be reserved for things that never move or change; when the static box is checked, it tells a number of scripts “Once you calculate something about this object, you can rely on that calculation being accurate for the rest of time”, including from the editor to play mode. Generally this means stuff like landscapes and level architecture, so that lighting and occlusion maps can be calculated and cached efficiently.
Prefabs are usually a poor fit for ‘static’ because it’s rare for a prefab to be this kind of unmoving object. If you’re doing something like spawning level layouts from prefabs, it might be better to spawn those by additively loading a scene instead.