Right now in my game there is a bit of a performance jerk the first time one of my game actors gets instantiated. The only thing I’ve thought to work around this is:
- Create a GameObjectPreload prefab with all the objects you want to be preloaded on scene load as children.
- Set the audio volume to 0.
- Load the GameObjectPreload prefab on scene start.
- Destroy the GameObjectPreload object and all of its children right away.
- Set the audio volume back.
Any other ideas?
Thanks,
-Jon
Don’t worry about it. We will be optimizing this case away.
Most likely this is building the novodex collision meshes when instantiating.
All assets do get preloaded correctly normally. We just have to fix some issues with the instantiation of collision meshes…
Does it affect things with purely primitive colliders? That’s all these have
Shouldnt be a problem with primitive colliders.
Is this in the editor or in the player?
(The first scene being the one that gets automatically loaded)
We don’t preload the first scene because it allows you to display the startupscreen as fast as possible.
All other scenes (Scenes you load with Application.LoadLevel) are always preloaded completely.
It’s in the player, and a G5 user even reported a hiccup the first time an enemy was instantiated, for instance.
Well then, after extensive Shark profiling, system tracing, and general wasted time…
Joachim pointed out that there is only one scene in the demo I was running, and therefore it wasn’t preloading anything.
So everyone just be aware that the scene at index zero isn’t preloaded, so you should act accordingly. 
-Jon